G
Guest
Let's say I have a form with two controls: ITEM_TYPE (a combo box), and
OPTION_1 (a check box). I want OPTION_1 to be invisible, except when
ITEM_TYPE is equal to "X", in which case OPTION_1 becomes visible so the user
can choose to check the option box if they wish.
WHAT I TRIED... I set the OPTION_1 Visible property to No and then inserted
code i got off this forum into ITEM_TYPE's AfterUpdate event.
The code is: Me.OPTION_1.Visible = (Me.ITEM_TYPE = "X") and it works just
fine.
THE PROBLEM... Yes the code works, but I put it in the wrong event. It only
begins working when the ITEM_TYPE field has just been updated. When i first
open the form, the OPTION_1 control remains invisible even on records where
ITEM_TYPE = "X" until ITEM_TYPE receives and looses focus, then all is well
as I scroll through the records.
MY QUESTIONS...
1. Is there a single event i can insert this code into to make it work right?
2. If not, then is it bad practice to put the code in multiple events to
make it work?
3. Am I going about this all wrong?
OPTION_1 (a check box). I want OPTION_1 to be invisible, except when
ITEM_TYPE is equal to "X", in which case OPTION_1 becomes visible so the user
can choose to check the option box if they wish.
WHAT I TRIED... I set the OPTION_1 Visible property to No and then inserted
code i got off this forum into ITEM_TYPE's AfterUpdate event.
The code is: Me.OPTION_1.Visible = (Me.ITEM_TYPE = "X") and it works just
fine.
THE PROBLEM... Yes the code works, but I put it in the wrong event. It only
begins working when the ITEM_TYPE field has just been updated. When i first
open the form, the OPTION_1 control remains invisible even on records where
ITEM_TYPE = "X" until ITEM_TYPE receives and looses focus, then all is well
as I scroll through the records.
MY QUESTIONS...
1. Is there a single event i can insert this code into to make it work right?
2. If not, then is it bad practice to put the code in multiple events to
make it work?
3. Am I going about this all wrong?