How to Use Variables

CharlesWhiteman

Registered User.
Local time
Today, 04:40
Joined
Feb 26, 2007
Messages
421
In my Db on a given event a txt file is written out to a UNC path. For example, when a new company is added to the Db a new list of companies is sent to a txt file on my server which updates my document management system.

If, however, i move the db to my laptop and want to use it exclusively there then there are quite a lot of variables which then need to be manually changed.

I was thinking that I could have a Tbl, say TblSysConfig which could contain/easily edit variables in the Db but so far am not sure how to refer to a field in a Tbl instead of the full UNC path.
 
If all you need is find ways to read/write to a table then search the forum for editing recordsets programmatically. There are plenty of examples you can use and modify to your heart's content.
 
Create your "preferences" table and then have an admin form bound to it so you can change the values. To pull the information in the code use a DLOOKUP.
 
Using that function have managed to achieve the desired result but for one point. Rather than having to meet the need to have many DLookup's want simply to Dlookup the main path and what remains constant to remain a basic string.

An original string below:

DoCmd.TransferText acExportFixed, "InvuListUpdate01", "InvuListUpdate01", "\\hpserver\d$\Integrasoft Limited Company Database\Link Manager\List Updates\CustomerCompanyName\InvuListUpdate01.txt"

What i need to have but cant seem to get to work is something like

DoCmd.TransferText acExportFixed, "InvuListUpdate01", "InvuListUpdate01", " DLookup("PathToFolder", "Tblconfiguration") & "Link Manager\List Updates\CustomerCompanyName\InvuListUpdate01.txt"
 
Solved As Below:

DoCmd.TransferText acExportFixed, "InvuListUpdate01", "InvuListUpdate01", DLookup("PathToFolder", "Tblconfiguration") & "Link Manager\List Updates\CustomerCompanyName\InvuListUpdate01.txt"
 

Users who are viewing this thread

Back
Top Bottom