Results 1 to 3 of 3
  1. #1
    PSSMargaret is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Dec 2016
    Posts
    55

    Browse to a File and Save Path in a Text Field

    The below code works great to capture the path and file name of a file and put it in the text box, however, it doesn't retain the data. When I return to the form, the path to the file is gone. What is the below missing in order to save the data in the text box?

    Code:
    Private Sub Command12_Click()    
        Dim dialog As FileDialog
        Set dialog = Application.FileDialog(msoFileDialogFilePicker)
    
    
    With dialog
        .AllowMultiSelect = False
        .Show
    Me.Text13 = .SelectedItems.Item(1)
    
    
        End With
    End Sub


  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    the textbox MUST be bound to a table field.

  3. #3
    PSSMargaret is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Dec 2016
    Posts
    55
    Thanks so much Ranman256. Makes perfect sense. I was experimenting in a form only without the text box bound to a table field.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 01-24-2016, 07:41 PM
  2. Replies: 21
    Last Post: 06-26-2014, 02:59 PM
  3. Browse buttons that save file path into field
    By Zandia in forum Import/Export Data
    Replies: 1
    Last Post: 06-04-2014, 02:55 PM
  4. Replies: 6
    Last Post: 05-27-2014, 05:41 AM
  5. Replies: 3
    Last Post: 07-30-2012, 02:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums