Making Tag Changes Persistent

  • Thread starter Greg_W via AccessMonster.com
  • Start date
G

Greg_W via AccessMonster.com

I want to programmatically assign a value to the tag property of an open form
and then save that change when I close the form so that I have access to it
when I open it the next time. Sounds pretty straight forward, but I'm finding
that the changes made to the tag are not being saved. Is this normal behavior
for Access forms? Before anyone asks, my close command already includes the
optioon acSaveYes. How can I have my form save changes to the tag property
that are made programmatically while the form is open?
 
J

Jeff Boyce

Greg

You've described "how" you want to do something, but not very much about the
"why" or "what". If you'll describe more about what having a persistent tag
in a form would allow you to do, the folks here may be able to offer
alternate approaches.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
D

Dirk Goldgar

Greg_W via AccessMonster.com said:
I want to programmatically assign a value to the tag property of an open
form
and then save that change when I close the form so that I have access to
it
when I open it the next time. Sounds pretty straight forward, but I'm
finding
that the changes made to the tag are not being saved. Is this normal
behavior
for Access forms? Before anyone asks, my close command already includes
the
optioon acSaveYes. How can I have my form save changes to the tag property
that are made programmatically while the form is open?


The only way you could do that directly would be to open the form in design
view. You could write the settings to a table, and load them back again in
the form's Open event. But if you're going to do that, it seems unnecessary
to use the Tag property at all.

What you ask is kind of an odd thing to want to do, so I agree with Jeff
that it would be a good idea to explain the problem you're trying to solve.
Then you might hear some alternative solutions.
 
K

Klatuu

Ditto to the 3 previous responses.

Now, without know the actual what you want to do, I would offer this.
You basically have two options. 1. A table to store the value when you
unload the form and to read the value from when you load the form. 2. Use the
CreateProperty method to create an application level property. The same
holds true for storing or reading the value when you close or open the form.

Now, based on what you are really doing, there may be other options.
 
G

Greg_W via AccessMonster.com

Klatuu and others,

Sorry I didn't give enough information. What I was working with was a Find
form that I use to search a subform's records. I wanted the user to be able
to recall his or her previous search, even from a previous session. So, I was
trying to save the txtFindWhat textbox content into the tag property. I
realize now from your posts that this cannot be done unless the form is in
design view. So, I will try one of the two solutions that you mention. Thanks
for your prompt replies.
 
L

Linq Adams via AccessMonster.com

For that you'd simply use a small utility table, store the value each time
the search is run, then retrieve when opening your form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top