Control Visible

Lou P

Registered User.
Local time
Today, 15:22
Joined
Jul 9, 2010
Messages
36
I have a form that contains a combobox (HW_Chassis) which I would like to remain invisible unless the Yes/No control (In_Chassis) is selected.

The If statement I used:

If Me.In_Chassis = True Then
Me.HW_Chassis.Visible = True
Else
Me.HW_Chassis.Visible = False
End If

It works...but the In_Chassis Yes/No Control does not have an "OnChange" event to use and all the ones that I tried required toggling the In_Chassis control to work.

Please advise...Thanks!
 
Think AFTER UPDATE event of the control.
 
Thanks...but I tried that. When I open the form the HW_Chassis control is not visible even on the records that have the In_Chassis control selected (True). It's like the If condition of In_Chassis does not get evaluated. When I toggle the In_Chassis control then it displays the HW_Chassis control.

I've used the same If statement on other controls but using the OnChange event. Unfortunately the Yes/No Controls do not have the OnChange.

Any other ideas? Thanks!
 
You don't use the on change event - it is RARE to use that event anyway.

You would also want to have the After Update event run in the form's On Current event to capture things that have already been entered. You can run the form's After Update event from the On Current by using:

Code:
Private Sub Form_Current()
   AfterUpdate
End Sub
 
Thanks SOS...I used a slight variation on that On Current for the form. I put my If statement in there as well as the After Update event on the In_Chassis control...works like a champ.

Next time you're quaffing a cool one pretend I bought it for you!

Thanks again!
 

Users who are viewing this thread

Back
Top Bottom