Updating an event procedure when switching between records

Paddy1980

Registered User.
Local time
Today, 07:09
Joined
Jan 29, 2009
Messages
18
Hi I am a novice to access but have written a case statement which grays out other check boxes when a value is selected from a drop down list. Thats fine but then when you switch back to old records with the value typed in I needs the case statement to apply to these as well.

Private Sub Name_AfterUpdate()
Select Case Name
Case Is = "Bob"
Me.check1.Enabled = False
Me.check2.Enabled = False
End Select
End Sub

I have tried putting this in the On Activate line on the form event tab but it does not gray the check boxes out on previous records.

Any help would be appreciated.
 
As Allan said, you'll need your code in the Form_Current event as well as the AfterUpdate event, but you need to modify your code to reset the Enabled Property for cases when "Bob" is not your uncle!

Code:
Select Case Name
Case Is = "Bob"
  Me.check1.Enabled = False
  Me.check2.Enabled = False
Case Else
  Me.check1.Enabled = True
  Me.check2.Enabled = True
End Select
 

Users who are viewing this thread

Back
Top Bottom