Hi,
Hoping someone could help - I've got a form with a text box that has a filename in (taken from a table in my database) - also a button that links to a Open File dialog box. When the button is pressed, I'd like the selected file to be updated in the text box and database.
I'm just getting a problem with the syntax on the update query, when looking through the Immediates Window, it's just giving SET File_Location = ' '
My code is as follows:
Many thanks for any help!
Hoping someone could help - I've got a form with a text box that has a filename in (taken from a table in my database) - also a button that links to a Open File dialog box. When the button is pressed, I'd like the selected file to be updated in the text box and database.
I'm just getting a problem with the syntax on the update query, when looking through the Immediates Window, it's just giving SET File_Location = ' '
My code is as follows:
Code:
strSQL = "UPDATE tbl_Dashboard SET File_Location = '" & varfile & "'"
Set objfilename = Application.FileDialog(msoFileDialogFilePicker)
objfilename.Show
With objfilename
.AllowMultiSelect = False
End With
For Each varfile In objfilename.SelectedItems
txtFileName.Value = "" & varfile & ""
DoCmd.SetWarnings False
Debug.Print strSQL
DoCmd.RunSQL (strSQL)
DoCmd.SetWarnings True
Next
Many thanks for any help!