views:

80

answers:

1

I have a form in Access 2007. In the form is a browse-file button. From the file-picker dialog the files name is saved in a VBA variable. And now to the question, how do I save the file name stored in the VBA-variable in the database?

The database has only one table.

Hope you can solve this, if not all information you need is provided, ask.

+3  A: 

Does the form use this table as the Record Source? If so, where ever in your vba you apply the value to this variable, the just apply the same value to the appropriate field:

Me.TheFileNameField = TheFileNameVariable

You could also use an Update query, for example:

strSQL="UPDATE SomeTable SET SomeField='" & Replace(TheFileNameVariable,"'","''") & "'"
CurrentDB.Execute strSQL, dbFailOnError
Jeff O
Excellent! Tanks :)
Johan