Programmically Saving Properties

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

[ Windows NT, Access 97 ]

I'm trying to save a form's property via its class module while it's in form
view (i.e., open). Although the property is successfully programmically set,
after the DoCmd.Save method is complete, and the form is closed, the new
value wasn't saved (e.g., resetting the Filter property for later use).
 
For stuff Like that I usually set up a Lookup Table..
It acts like a repository for global 'variables' that will remain after time.
In this table I have the following fields:

LuType - LookupType simply an identifier
PrimaryValue - Text, Text value of what you're storing


So in your example, make a here's what the table might look like
LuType PrimaryValue
-------- ----------------
MY_FORM_FILTER someField = 'test'


So, somewhere maybe on the form unload event, 'save' the filter to this
variable.

Then in form load, grab the filter from the table and set it.

HTH
 
Although I'd still like to know how to save a form's properties
programmically, your methodology is fantastic! I never thought of it. It
opens up a whole new world to me.

Thanks, Tom.
--
Trent Argante
[DC.J(227)!(343)]


TomHinkle said:
For stuff Like that I usually set up a Lookup Table..
It acts like a repository for global 'variables' that will remain after time.
In this table I have the following fields:

LuType - LookupType simply an identifier
PrimaryValue - Text, Text value of what you're storing


So in your example, make a here's what the table might look like
LuType PrimaryValue
-------- ----------------
MY_FORM_FILTER someField = 'test'


So, somewhere maybe on the form unload event, 'save' the filter to this
variable.

Then in form load, grab the filter from the table and set it.

HTH









Trent Argante said:
[ Windows NT, Access 97 ]

I'm trying to save a form's property via its class module while it's in form
view (i.e., open). Although the property is successfully programmically set,
after the DoCmd.Save method is complete, and the form is closed, the new
value wasn't saved (e.g., resetting the Filter property for later use).
 
NP..

Trick I picked up at another company (I certainly didn't think of it.)

I had a tough time accepting it because if you're a purist, it isn't a
normalized table, BUT I use it for all kinds of stuff..

populating choices in combo boxes for example..

make several rows with the same time
ie

STOP_LIGHT_COLORS Red
STOP_LIGHT_COLORS Yellow
STOP_LIGHT_COLORS Green

Anywhere you have a combo that needs STOP_LIGHT_COLORS, just reference the
lookups...

btw, your welcome!!












Trent Argante said:
Although I'd still like to know how to save a form's properties
programmically, your methodology is fantastic! I never thought of it. It
opens up a whole new world to me.

Thanks, Tom.
--
Trent Argante
[DC.J(227)!(343)]


TomHinkle said:
For stuff Like that I usually set up a Lookup Table..
It acts like a repository for global 'variables' that will remain after time.
In this table I have the following fields:

LuType - LookupType simply an identifier
PrimaryValue - Text, Text value of what you're storing


So in your example, make a here's what the table might look like
LuType PrimaryValue
-------- ----------------
MY_FORM_FILTER someField = 'test'


So, somewhere maybe on the form unload event, 'save' the filter to this
variable.

Then in form load, grab the filter from the table and set it.

HTH









Trent Argante said:
[ Windows NT, Access 97 ]

I'm trying to save a form's property via its class module while it's in form
view (i.e., open). Although the property is successfully programmically set,
after the DoCmd.Save method is complete, and the form is closed, the new
value wasn't saved (e.g., resetting the Filter property for later use).
 
Trent Argante said:
[ Windows NT, Access 97 ]

I'm trying to save a form's property via its class module while it's
in form view (i.e., open). Although the property is successfully
programmically set, after the DoCmd.Save method is complete, and the
form is closed, the new value wasn't saved (e.g., resetting the
Filter property for later use).

In what event are you setting the property? When are you saving it?
Please post the code you're using.
 
Back
Top