Link to home
Start Free TrialLog in
Avatar of Patrick O'Dea
Patrick O'DeaFlag for Ireland

asked on

Disabling a field based on another

See my VBA below.

I have not used this before.

When I compile the "Enabled" bit is highlighted with an error "Invalid Use Of Property".

Is my syntax wrong??
I have tried different combinations but no joy!
Private Sub Form_Current()
If tblCustomers.OverrideYN = "Y" Then Me.OverRidePrice.Enabled
Else
Me.OverRidePrice.Locked
End If
End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Patrick O'Dea

ASKER

Thanks again.

I should have known that one!
You can say
if x then ...
because that gets interpreted as
if x is true then....

But when assigning values an ' = True/false'  must be used.
Thanks Peter,  

I will try to remember that one.