vba to disable control

gaccess

Registered User.
Local time
Today, 22:28
Joined
Apr 17, 2011
Messages
32
This must be simple "OR" I am
The following code I am trying to disable or lock a control depending on the value of a combo box
This works fine with one value BUT I want to lock Control4 with values 3 or 4

I have had the lines as
If Me.SupplyToFK = "3" OR "4" Then
If Me.Combo1 = "3" OR "4" Then
but it just don't work

Private Sub Combo1_AfterUpdate()
Me!Combo2.Requery
If Me.SupplyToFK = "3" Then
Me.Control4.Locked = True 'User not allowed access
Else
Me.Control4.Locked = False
End If
End Sub

Private Sub Control4_Enter()
If Me.Combo1 = "3" Then
MsgBox ("Go Away'), vbOKOnly, "Entry Disallowed"
Else
End If
End Sub
help
 
Your syntax is not quite right you need to use;
Code:
If Me.SupplyToFK = "3" OR Me.SupplyToFK =  "4" Then
 

Users who are viewing this thread

Back
Top Bottom