Between If Statement

  • Thread starter Thread starter DS
  • Start date Start date
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
 
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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

An Easier Way 12
date function 6
Convert String to Datetime in SQL 6
OnFormat Event for Calendar Detail Duane Hookom 2
Sum different Columns 1
Null Date 9
Allen Browne's Calendar Control 4
IIf(Nz) statement 3

Back
Top