How to Control a field based upon the value of another field

Let us discuss here about the doubts those may arise while using MS Access

How to Control a field based upon the value of another field

Postby guest » Sat Oct 31, 2009 6:40 pm

How to enable or disable a field, say [age] based upon the entry of another field, say [sex] in the same form?
guest
 
Posts: 7
Joined: Tue Aug 25, 2009 9:45 pm

Re: How to Control a field based upon the value of another field

Postby james » Sat Oct 31, 2009 6:45 pm

On the AfterUpdate Event of [sex], put the code

If (Me![sex].Value = "A") Or (Me![sex].Value = "B")Then
Me![age].Enabled = True
Else
Me![age].Enabled = False
End IF


And to be sure it's disabled when the form opens, put
Me![age].Enabled = False on the OnOpen event.
james
Site Admin
 
Posts: 25
Joined: Wed Apr 22, 2009 6:36 pm


Return to Micro Soft Access -Doubts

Who is online

Users browsing this forum: No registered users and 1 guest

cron