File Path retrival

A

Adrian1701

Hi

Hope I am posting to the right forum, please excuse if I am wrong.

I am a newbie to programing of any type. I am trying to create
facility in a MS database which, based on a comand butont will open
dialog box to enable the user to browse to a location of a file. Havin
found the file the pathname is retrieved and put into a record field i
an access database table. Specifically the file the path will b
directed to will be an image file and will be bound to each record, i.
changes for every record.

I can call the commondialog control, and I can handle the image displa
in the form. I just need to know how to make the join and get the pat
into the table. I know I can do this manually by typing in each pat
for each record on the table, but i want to handle this with a simple
point and click methodology.

Any suggestions would be very greatfully recieved.

Thanx

Adria
 
K

Klatuu

If you can call the common dialog box, then you are home free. The common
dialog box returns the path and file selected. you just need to put the
results of the common dialog call into a field in your table.
 
A

Adrian1701

Thanks for the response. However I am still not sure what I need to d
to get the path name result from the commondialog box into the table.

So far I have a command button, which when pressed brings up the dialo
box, from which I can browse to a location a choose a file, specificall
an image file. The picture is then shown in an image control on th
form. If I got into the asscociated table no path is shown in th
record field for the image. I think it actualy says package?

Any clues?

Thanx

Adria
 
K

Klatuu

I don't know what code is behind the command button that shows the common
dialog, but here is something from one of my apps that may help:

cdlBackEnd.ShowOpen
If Err = 32755 Then 'Cancel was selected
DoCmd.Quit
Else
strNewPath = cdlBackEnd.FileName

cdlBackEnd is the name of the control on the form.
Error 32755 means the user closed the dialog box without selecting a file
strNewPath is a variable that now contains the path and filename of the
selected file.
..FileName is the property of the common dialog box that that contains the
file name.

Hope this helps.
 

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