Need user to input file path, whats the best way?

meadt

Registered User.
Local time
Today, 21:03
Joined
Oct 29, 2009
Messages
45
Hi Guys,

I need something that will allow the user to enter a file path before running a function. I was thinking using a combo box or something on the main form, but I'm not sure. If this is the best way how would I link whatever is entered with a variable in the code?

Cheers for your help again,
 
I use a text field. A function will bring up a browse window, they find the folder and hit OK. It puts the folders full path in the text field. Then the code will just refer to, for example:

Forms!frmImport.txtImport.Value

There are free functions out there that can be used to browse for a folder.
 
Thanks for your help guys, that'll be perfect.

One last problem, I can't get the VBA function to recognise whats in the text box. Ive called the text box FilePath and defined it in the code as string but when I run 'msgbox filepath' the message box comes up with nothing.

I'm pretty sure that I'm missing something simple, but I'm new to all this and its a steep learning curve!
 
Thanks for your help guys, that'll be perfect.

One last problem, I can't get the VBA function to recognise whats in the text box. Ive called the text box FilePath and defined it in the code as string but when I run 'msgbox filepath' the message box comes up with nothing.

I'm pretty sure that I'm missing something simple, but I'm new to all this and its a steep learning curve!

Where in your code are you running it?

Try Me.txtBoxName or Me.txtBoxName.Value

If it's not in the forms code, you need to reference the form name:

Forms!formName!txtBoxName.Value
 

Users who are viewing this thread

Back
Top Bottom