pathsettings

N

Nick

Hello,

Could someone tell me what the best way is to use paths in
a form? I want to import data from a specified folder on
our network using a form.
How can i achieve this, must i use a .ini file to store
the settings or should i save it in a table?
 
H

Hugh O'Neill

Nick said:
Hello,

Could someone tell me what the best way is to use paths in
a form? I want to import data from a specified folder on
our network using a form.
How can i achieve this, must i use a .ini file to store
the settings or should i save it in a table?


Here is an example of inputting from a file in a path:

strPath = "PathToYourFileFolder"
strPath = strPath & "NameOfYourFile"
DoCmd.TransferText acImportDelim, "YourImportSpecificationName Import
Specification", "NameOfYourTableForImportingTo", strPath

The above will wrap, so you should read the DoCmd line as the final
single line.

hth

Hugh
 
N

Nick

-----Original Message-----



Here is an example of inputting from a file in a path:

strPath = "PathToYourFileFolder"
strPath = strPath & "NameOfYourFile"
DoCmd.TransferText
acImportDelim, "YourImportSpecificationName Import
Specification", "NameOfYourTableForImportingTo", strPath

The above will wrap, so you should read the DoCmd line as the final
single line.

hth

Hugh
.
Hi Hugh,

Thanks for your example. However i have a another
question. How should i use it if the pathname is variable.
For instance if a user wants to specify another path, then
i must change the path in code.
Do you also have a example where i don't need to hardcode
the path in vba.
 
H

Hugh O'Neill

Nick said:
acImportDelim, "YourImportSpecificationName Import

Thanks for your example. However i have a another
question. How should i use it if the pathname is variable.
For instance if a user wants to specify another path, then
i must change the path in code.
Do you also have a example where i don't need to hardcode
the path in vba.


I haven't needed to do that, so may be some one else has a solution to
variable path names. I know there is a solution but I've nevver used
it.

Hugh
 

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