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
|
|||
|
|||
Use Tag property to load a string into a Text Box
A2K,
Here's a simple one I can't get to work. On a form, the cmdBrowse button displays the chosen destination folder path in txtFolderName. The user then clicks cmdGO button to call a function that uses the path in txtFolderName. The user then closes the form. I want the same folder path to appear next time the form is opened, so the user doesn't have to Browse again. I tried a line of code in the On_Click event of cmdGO that stores the string in the Tag, like: cmdOK.tag = txtFolderName Then a line in the Load event for the Form to paste the Tag, like: txtFolderName = cmdOK.tag The string correctly appears in the cmdOK Tag line in the Properties box, but when I open the form again the txtFolderName box is blank. What's going wrong? Brad H. |
#2
|
|||
|
|||
Hi Bradley,
Run-time changes to forms are not saved. Better to store "user settings" like this in a table where data's meant to be keptg. Set up a little table along these lines: tblSettings SettingName - Text (32 charcters max) - Primary key SettingValue - Text (255) and create a record with SettingName = "DefaultOutputFolder" or some such. Then store the new value with something like DBEngine(0)(0).Execute "UPDATE tblSettings SET SettingValue=""" _ & Me.txtFolderName.Value _ & """ WHERE SettingName=""DefaultOutputFolder"";" and retrieve it with something like Me.txtFOlderName.Value = DLookup("SettingValue", tblSettings, _ "SettingName=""DefaultOutputFolder""") On Tue, 14 Dec 2004 19:39:00 -0800, "Bradley C. Hammerstrom" bhammerstrom @ NOTTYSPAMrhadcock.com wrote: A2K, Here's a simple one I can't get to work. On a form, the cmdBrowse button displays the chosen destination folder path in txtFolderName. The user then clicks cmdGO button to call a function that uses the path in txtFolderName. The user then closes the form. I want the same folder path to appear next time the form is opened, so the user doesn't have to Browse again. I tried a line of code in the On_Click event of cmdGO that stores the string in the Tag, like: cmdOK.tag = txtFolderName Then a line in the Load event for the Form to paste the Tag, like: txtFolderName = cmdOK.tag The string correctly appears in the cmdOK Tag line in the Properties box, but when I open the form again the txtFolderName box is blank. What's going wrong? Brad H. -- John Nurick [Microsoft Access MVP] Please respond in the newgroup and not by email. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
What if the back-end "moves"? | John S. Ford, MD | General Discussion | 13 | November 15th, 2004 09:33 PM |
Finding Text String Within A String With A Formula | Sandi | General Discussion | 5 | August 17th, 2004 08:39 PM |
scrolling programmatically? | alekm | New Users | 1 | July 6th, 2004 02:56 AM |
adding a space to a text string | [email protected] | Worksheet Functions | 1 | February 19th, 2004 05:06 PM |