Between If Statement

D

DS

I can't quie get the synatax for a between statement.
Any help appreciated.
Thanks
DS


If Me.D34 is between 29 and 31 Then
Me.TxtDay = Me.D34
Me.TxtDate = Me.TxtMonth & "/" & Me.TxtDay & "/" & Me.TxtYear
Else:
Me.TxtDate = ""
End If
 
T

Tom Lake

I'd do this:

If Me!D34 >= 29 And Me!D34 <= 31 Then
Me!TxtDay = Me!D34
Me!TxtDate = Me!TxtMonth & "/" & Me!TxtDay & "/" & Me!TxtYear
Else
Me!TxtDate = ""
End If

Tom Lake
 
J

J. Goddard

The post from Tom Lake shows the proper if statement:

If Me!D34 >= 29 And Me!D34 <= 31 Then
Me!TxtDay = Me!D34
Me!TxtDate = Me!TxtMonth & "/" & Me!TxtDay & "/" & Me!TxtYear
Else
Me!TxtDate = ""
End If

John
 
D

DS

J. Goddard said:
The post from Tom Lake shows the proper if statement:

If Me!D34 >= 29 And Me!D34 <= 31 Then
Me!TxtDay = Me!D34
Me!TxtDate = Me!TxtMonth & "/" & Me!TxtDay & "/" & Me!TxtYear
Else
Me!TxtDate = ""
End If

John
Thank you that worked perfectly!
DS
 
Top