Set control to disabled when leaving form

DJBummy

Registered User.
Local time
Today, 23:09
Joined
Jun 22, 2001
Messages
90
I wish allow the user to enable or disable several controls on a form based on certain conditions during the year.
I have no problem doing this when the form is open using a command button but after leaving form and returning the controls revert back to there original state.
I would like to set the controls to disabled in form view and leave them that way until the user wishes to change them back in some future time.

thanks in advance
 
I'm guessing you will need to store these settings in a table and retrieve them each time the form opens.
 
As Ken said, you'll need a utility table to store then retrieve thses settings from each time the form opens, unless these "certain conditions during the year" are something Access can check on and then conditionally set the controls.
 
Thank you both for your replies
I resolved this problem by doing as you suggested.
I created a yes/no field in the forms storage table. I then placed the yes/no control on the form with the visible property set to false.
I then change the check box to either true or false based on the condition of the command button that activates or deactivates the desired controls and store that value in the table.
When the user reopens the form I use the Open Form event to check the condition of the check box and enable or disable the appropriate controls.
Works like a charm.

Thanks again
 
Just a follow up to this post.

I found that by creating the yes/no field in the forms storage table this did not work because every time the user went to a new record the yes/no was changed.
The resolution was to create a seperate table with only a yes/no field in it and one record. This also saves from having a bunch of yes/no records in my other tables.
I have a Main Menu that the user navigates with. So I just put a button on the main form to change the status of the yes/no field.
Then in the forms I use a unbound dlookup control to check the status of the yes/no field and turn the appropriate controls on or off depending on the dlookup control.
NOW IT ACTUALLY DOES WORK LIKE A CHARM!
 
Sorry, we should have made that point clearer! We meant that you'd need a separate "utility" table for this!

Glad you got it working!

Linq
 

Users who are viewing this thread

Back
Top Bottom