pathsettings

  • Thread starter Thread starter Nick
  • Start date Start date
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?
 
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
 
-----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.
 
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
 
Back
Top