Results 1 to 7 of 7

Thread: Button

  1. #1
    Join Date
    Mar 2004
    Posts
    18

    Unanswered: Button

    I'm looking for a formant with button to place in a access form, which allows me to explore my disk for a file, I want to put in the database. What is the name of this formant and where can I find it?

  2. #2
    Join Date
    Nov 2002
    Location
    Belgium
    Posts
    243

    Re: Button

    Originally posted by konwin
    I'm looking for a formant with button to place in a access form, which allows me to explore my disk for a file, I want to put in the database. What is the name of this formant and where can I find it?

    Is this what you are looking for?

    Search for 'FileDialog' in Access-help.
    Before you can use it be sure you need a reference to Microsoft Office library.

    Code:
    Sub Main()
    
        'Declare a variable as a FileDialog object.
        Dim fd As FileDialog
    
        'Create a FileDialog object as a File Picker dialog box.
        Set fd = Application.FileDialog(msoFileDialogFilePicker)
    
        'Declare a variable to contain the path
        'of each selected item. Even though the path is a String,
        'the variable must be a Variant because For Each...Next
        'routines only work with Variants and Objects.
        Dim vrtSelectedItem As Variant
    
        'Use a With...End With block to reference the FileDialog object.
        With fd
    
            'Use the Show method to display the File Picker dialog box and return the user's action.
            'The user pressed the action button.
            If .Show = -1 Then
    
                'Step through each string in the FileDialogSelectedItems collection.
                For Each vrtSelectedItem In .SelectedItems
    
                    'vrtSelectedItem is a String that contains the path of each selected item.
                    'You can use any file I/O functions that you want to work with this path.
                    'This example simply displays the path in a message box.
                    MsgBox "The path is: " & vrtSelectedItem
    
                Next vrtSelectedItem
            'The user pressed Cancel.
            Else
            End If
        End With
    
        'Set the object variable to Nothing.
        Set fd = Nothing
    
    End Sub

  3. #3
    Join Date
    Mar 2004
    Posts
    18
    thanks

  4. #4
    Join Date
    Nov 2002
    Location
    Belgium
    Posts
    243
    Originally posted by konwin
    thanks
    You're welcome.
    If you need more, just let me know

  5. #5
    Join Date
    Mar 2004
    Posts
    18

    link to a web site

    Originally posted by artemide
    You're welcome.
    If you need more, just let me know
    How should the code for a button look like to make a button a link for a web site? I mean in VBS in a MS Access Data Access Page.

  6. #6
    Join Date
    Mar 2004
    Location
    Somewhere
    Posts
    21
    If you want to link to a website just right click on the button and go down to hyperlink, enter the url and it should work.
    CU Blitz

  7. #7
    Join Date
    Mar 2004
    Posts
    18
    Originally posted by blitzaceuk
    If you want to link to a website just right click on the button and go down to hyperlink, enter the url and it should work.
    It dosn't work. Doing this I get a hyperlink extra as a text hyperlink.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •