Enabled Fields

Lynn_AccessUser

Registered User.
Local time
Today, 02:49
Joined
Feb 4, 2003
Messages
125
I have 2 fields txtExample1 txtExample2. If a user enters data in txtExample1 field txtExample2.enabled = false and and visa versa.

I added the code to the On Change Event:

If IsNull(Me!txtExample2) Or Me!txtExample2= "" Then
txtExample1 .Enabled = True
Else
txtExample1 .Enabled = False
End If

It doesn't work and I am not sure if it is the code or the event or both. Thanks!
 
I hope is just a typo but I noticed that there is a single space after the txtExample1 and before the .Enabled in your code.

Also, try the OnCurrent event instead of the OnChange event.

If IsNull(Me!txtExample2) Or Me!txtExample2= "" Then
txtExample1 .Enabled = True
Else
txtExample1 .Enabled = False
End If

HTH
 
Sorry, I started out with text boxes and then switched them to combo boxes so there is no On Current Event. The space is a result of the code being copied and pasted to the newsgroup.

Any other suggestions?
 
Got it! Code was correct . . . logic was wrong. I was putting the code on the wrong field. Should have put the code on txtExample2 event property.
 

Users who are viewing this thread

Back
Top Bottom