Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

enable a text box via a yes or no button 1

Status
Not open for further replies.

kwilsokl

MIS
Apr 21, 2005
15
US
I have code to enable a text box that is not enabled when a form starts up until a yes or no button is checked. It works but when you go to a new record the text box is still enabled.

How do I get it to reset the text box to the value of enable = false for new records

Below is my code

Any help is appreciated

Thanks

Private Sub Employable_AfterUpdate()
If Me.Employable = True Then
Me.Employer.Enabled = True
Else
Me.Employer.Enabled = False
End If
End Sub
 
You may try this event procedures:
Code:
Private Sub Employable_AfterUpdate()
Me!Employer.Enabled = Me!Employable
End Sub

Private Sub Form_Current()
If Me.NewRecord Then
  Me!Employer.Enabled = False
Else
  Me!Employer.Enabled = Me!Employable
End If
End Sub

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
WOW that worked great. Thank you

I hope I am not taking advantage but I am trying to really learn this. Why did you use the me! Value instead of calling the name of the field you wanted to work with.


Also how would I have known that I needed to add more code for the sub form current?

Thank you for all the help, you really know your stuff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top