Using to Browse to a folder and save the location

P

PhilipBenno

Hello

I'am wanting to create a form with a browse button to find a specific
filename on a disk,folder and save the location to a tablie linked by a key
from another table. ie Ref No From table one linked and saved to results from
browse button (table2).

When I call up the Ref no it will go and search for table2 for the disk and
folder and filename to call up the .doc or any filename saved,if no results
are found then to ask the question where the filename located and again to
save the results to table2.

Can this be done?
 
A

Allen Browne

1. Click on the Modules tab of the Database Container.
Click new. Access opens a new module.

2. Paste in everything between:
'***************** Code Start **************
and
************** Code End *****************

3. Save the module with a name such as modAPI.

4. Still in the code window, choose Compile on the Debug menu to ensure
Access understands this.

5. Press Ctrl+G to open the Immediate Window.
Enter this:
? TestIt()

Now that you have the code working, you can use it in the Click event
procedure of your button.
 
P

PhilipBenno

Hi Alan

Thanks for the help,just one quick thing when I call the function
getopenfile it locates the drive,directory,filename. But when I try to write
the contents to another table it creates a duplicate record,I found this out
when I put a autonumber on the key,it's when a use the command ie
coshlocation.addnew,it call's the function up again even though the command
call getopenfile has already executed 4 lines before.
 
A

Allen Browne

Sounds like you have the FileOpen code working properly, and you now have a
problem with your Addnew code.
 

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