browse for file and entering the file path in a table

S

sadat

Hi.
I am using browse button and the address bar in the form for the first time.
I found the vba code from this webstie:
http://www.mvps.org/access/api/api0001.htm
I want to select any file using browse button and then populate the address
of the file to a table.
My problem is when I use the address bar and the browse button as "Unbound",
it works. But when i try to populate the table using the browse button and
address bar, it says: Run time error '424'. What I am doing wrong here?
Please guide me so that I can get rid of this problem.

Thanks and regards,
Sadat
 
P

Piet Linden

Hi.
I am using browse button and the address bar in the form for the first time.
I found the vba code from this webstie:http://www.mvps.org/access/api/api0001.htm
I want to select any file using browse button and then populate the address
of the file to a table.
My problem is when I use the address bar and the browse button as "Unbound",
it works. But when i try to populate the table using the browse button and
address bar, it says: Run time error '424'. What I am doing wrong here?
Please guide me so that I can get rid of this problem.

Thanks and regards,
Sadat

you need this part...
GetOpenFile(strDirectory, strTitle)

as in ...

Dim strMyFile As string ' somewhere to stuff your filename

strMyFile = GetOpenFile("C:\", "Pick a file, any file!")

You could also assign the value of GetOpenFile to a control on your
form...
Me.txtFileName = GetOpenFile("C:\", "Pick a file...")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top