IF statement to enable two text boxes (1 Viewer)

scubadiver007

Registered User.
Local time
Today, 12:11
Joined
Nov 30, 2010
Messages
317
This ain't workin'

Code:
If Me.Gender = "male" Then
Me.MaternitySDate.Enabled = False And Me.MaternityDate.Enabled = False
ElseIf Me.Gender = "female" Then
Me.MaternitySDate.Enabled = True And Me.MaternityDate.Enabled = True

It must be something simple...
 

pr2-eugin

Super Moderator
Local time
Today, 20:11
Joined
Nov 30, 2011
Messages
8,494
Try this..
Code:
If Me.Gender = "male" Then
    Me.MaternitySDate.Enabled = False
    Me.MaternityDate.Enabled = False
Else
    Me.MaternitySDate.Enabled = True 
    Me.MaternityDate.Enabled = True
End If
And is a Logical Operator, not a Concatenation operator.. Also, I believe there are only two options for Gender so there is no need for an ElseIf.. as it is waste of computational space and time..
 

scubadiver007

Registered User.
Local time
Today, 12:11
Joined
Nov 30, 2010
Messages
317
Useful to learn, thanks.
 

Users who are viewing this thread

Top Bottom