0

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.

1 Answer 1

4

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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.