If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Write a variable value in a .txt file
Hello.
Can anyone tell me (very slowly, please), how can I store a variable in a ..txt file? I want the user to choose a path to a specific folder, and I want to store that path for every time the user opens the database, unless he change it again. Thanks in advance for the help. |
#2
|
|||
|
|||
Write a variable value in a .txt file
Look up the OpenTextFile method:
Sub OpenTextFileTest Const ForReading = 1, ForWriting = 2, ForAppending = 3 Dim fs, f Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.OpenTextFile("c:\testfile.txt", ForAppending,TristateFalse) f.Write "Hello world!" f.Close End Sub However, have you considered storing this string in a table in the FE application? You can create a table and keep just one record in it or more if you have many such stored variables. Then the application would be fully self-contained and there would be less chance of the variable being deleted, lost, etc. acores wrote: Hello. Can anyone tell me (very slowly, please), how can I store a variable in a .txt file? I want the user to choose a path to a specific folder, and I want to store that path for every time the user opens the database, unless he change it again. Thanks in advance for the help. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...esign/200610/1 |
Thread Tools | |
Display Modes | |
|
|