PDA

View Full Version : Storing updated .tag property in new dot



village_alchemist
08-19-2004, 11:45 AM
I need to keep track of various values in my template, so I thought that using the tag property would be a convenient method. It does work well, but I wanted to have a VP (non-programmer) update the values through a config screen and then save the template with a new version number.

My problem is that during execution everything seems to work fine, but when I save to a new template file, the tag values haven't changed in the new file. I've discovered that after I set a tag property, if I pause the execution and look at the properties for that control, the tag property really hasn't changed.

Help? :confused:

jamescol
08-19-2004, 11:59 AM
Can you post your code so we can see what's happening?

Thanks
James

village_alchemist
08-19-2004, 12:20 PM
Here is a simple example with a textbox called txtCfgCarrBase. When the user changes the value of the textbox, I change the value of the tag property. The memory variables change so I can use the new value elsewhere, but it's not changing the actual tag property of the control itself.


Private Sub txtCfgCarrBase_Change()
txtCfgCarrBase.Tag = txtCfgCarrBase.Text
End Sub

TonyJollans
08-19-2004, 12:31 PM
The problem here is that you are confusing the userform1 class definition with a single instance of the userform. When you change the tag in your instance of the userform it does just what you ask, but it does not change the underlying class definition.

This is a pretty unusual method of saving user settings - or are they more than that. Is there a particular reason for wanting to save them in a versioned template?

village_alchemist
08-19-2004, 01:23 PM
These aren't user based settings. They are values (about 20) that all users will use and that should only be changed by an admin of the template. My problem is that we have a distributed work force and not everyone is connected to the company network, and none of the form users have a clue about keeping files in a certain place or even together. So if *everything* is stored in the one template, I won't have a support nightmare.

If I have to, I'll just set the tag property in the class definition (thanks for that insight!) and I'll have to edit it when they want something changed. But I'd prefer to do it through my form, if possible.

TonyJollans
08-19-2004, 01:53 PM
Is there a need to attach the values to the userform or could you use, say, custom properties of the template?

village_alchemist
08-19-2004, 02:26 PM
No reason to have them associated with the form itself. Using custom properties of the template would work, I suppose similar to how Adaytay is keeping his number. I have 20 separate values that need to be kept though.

village_alchemist
08-19-2004, 07:23 PM
Tony, Thanks again for the suggestion of the custom properties. After some time in the help file and a little experimentation, it is all working great! I've got all 20 of my custom properties setup and working with my userform so the template admin can make adjustments as needed. Combined with JOrzech's suggestion of AutoText for inserting pre-formatted sections and I should be able to wrap this project up this week.