File Browse Button

qwert231
09-28-2001, 07:51 AM
I currently have a form with a button that first gives an Inputbox prompt, then uses that value for a DoCmd.TransferText function. The Inputbox is asking for a file name. Is there anyway in Access2k VBA to prompt with a FileOpen box and return that value to the TransferText function? Thanks.

karimahta
10-01-2001, 05:44 AM
You can call the File Open Common Dialog using Windows API calls.

Click on this link Dev Ashish's The Access Web page (http://www.mvps.org/access/api/api0001.htm) to see the code required and an explanation.
Drop this code into a separate module in Access and use it whereever you need.

OR

You could use the ActiveX Microsoft Common Dialog Control by selecting it from the tools menu and dropping it onto your form.

I prefer the code version as you don't have to ensure the control is installed on the users machine. But the OCX can be easier to understand.


Also check out this site as it may have some other interesting tips.


HTH


<font color=blue>I once had an itch that I scratched and off fell my leg.</font color=blue>

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum