Browse Button

  • Thread starter Greg M. via AccessMonster.com
  • Start date
G

Greg M. via AccessMonster.com

1. I'd like to use a button on my form to browse for a file on the network
2. and then once the file is located place the name of the file in the text
box.
3. I would later need to save and then reference that text field so that the
user can click on it and have the file open up in its native application.

I looked at The Access Web at http://www.mvps.org/access/api/api0001.htm, but
I'm not sure if the code should go in the button click or in a module. This
code has a lot in it and I'm not sure how to apply it to my situation above.

Please help.

Thanks,
Greg
 
B

Bob

Generally you want to set the OnClick event for your button to [Event
Procedure] and place your code in the form's module. The easy way to do
that is to click the build button on the right side of the OnClick
event property field in the properties box and choose "Code Builder".
The code builder wizard will create an event procedure with the correct
name in the form's module, and open the VB editor for you to enter code.
 
G

Greg M. via AccessMonster.com

I placed the code in the button using the code builder, but the compile is
giving me a lot of errors. The first error is at the "declare function" line
stating only comments can come after a end function or end sub.

Has anyone a clean version of this code?

Placing the code in the VB editor also breaks it into separate sub procedures.
Is this correct?

Thanks,
Greg
Generally you want to set the OnClick event for your button to [Event
Procedure] and place your code in the form's module. The easy way to do
that is to click the build button on the right side of the OnClick
event property field in the properties box and choose "Code Builder".
The code builder wizard will create an event procedure with the correct
name in the form's module, and open the VB editor for you to enter code.
 
B

Bob

I looked at the URL you posted, and it looks as if the code is intended
to be cut and pasted into the editor; i.e. it should work as it is. Why
don't you cut the code from the module and post it here so we can see
it?

Bob
 

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