M morlan Registered User. Local time Today, 04:50 Joined Apr 23, 2003 Messages 143 Jun 24, 2003 #1 If a certain event happens it will change the enabled property of an object eg. If me.txtAge < 18 Then me.txtName.Enabled = No Any ideas
If a certain event happens it will change the enabled property of an object eg. If me.txtAge < 18 Then me.txtName.Enabled = No Any ideas
missinglinq AWF VIP Local time Yesterday, 23:50 Joined Jun 20, 2003 Messages 6,417 Jun 24, 2003 #2 That about right. Just need to add the End If. If me.txtAge < 18 Then me.txtName.Enabled = No End If I think the only caveat is that the control being disabled cannot have the Focus at the time of disablement. Hope this helps. The Missinglinq
That about right. Just need to add the End If. If me.txtAge < 18 Then me.txtName.Enabled = No End If I think the only caveat is that the control being disabled cannot have the Focus at the time of disablement. Hope this helps. The Missinglinq
IMO Now Known as ___ Local time Today, 04:50 Joined Sep 11, 2002 Messages 723 Jun 24, 2003 #3 Place the code in the LostFocus() event Private Sub txtAge_LostFocus() If Me.txtAge < 18 Then Me.ANOTHERCONTROL.SetFocus Me.txtAge.Enabled = False End If End Sub IMO
Place the code in the LostFocus() event Private Sub txtAge_LostFocus() If Me.txtAge < 18 Then Me.ANOTHERCONTROL.SetFocus Me.txtAge.Enabled = False End If End Sub IMO
R Rich Guest Jun 24, 2003 #4 The code should be in the Form_Current event and "called" in the AfterUpdate event of txtAge, otherwise if users don't tab into and out of txtAge the code will not work, assuming you want the condition to work for existing records as well that is
The code should be in the Form_Current event and "called" in the AfterUpdate event of txtAge, otherwise if users don't tab into and out of txtAge the code will not work, assuming you want the condition to work for existing records as well that is