Need help with date syntax error

  • Thread starter Russ via AccessMonster.com
  • Start date
R

Russ via AccessMonster.com

trying to open form based on two dates;

stLinkCriteria = "[TransactionDate]=Between #" & Me.Beginning_Trans_Date & "#
and #" & Me.Ending_Trans_Date & "#"""

Do not know where I went wrong, please help.
Thanks
 
J

John Vinson

trying to open form based on two dates;

stLinkCriteria = "[TransactionDate]=Between #" & Me.Beginning_Trans_Date & "#
and #" & Me.Ending_Trans_Date & "#"""

Do not know where I went wrong, please help.
Thanks

The = operator searches for one value. The BETWEEN operator searches
for a range between two values. Use one or the other, not both. You
also have an extra pair of uneeded quotes at the end:

stLinkCriteria = "[TransactionDate] Between #" &
Me.Beginning_Trans_Date & "# and #" & Me.Ending_Trans_Date & "#"


John W. Vinson[MVP]
 
D

Duane Hookom

Try:
stLinkCriteria = "[TransactionDate]=Between #" & Me.Beginning_Trans_Date &
"# and #" & Me.Ending_Trans_Date & "#"
 
R

Russ via AccessMonster.com

John,
this one did the trick, thanks!

stLinkCriteria = "[TransactionDate]Between #" & Me.Beginning_Trans_Date & "#
AND #" & Me.Ending_Trans_Date & "#"

John said:
trying to open form based on two dates;
[quoted text clipped - 3 lines]
Do not know where I went wrong, please help.
Thanks

The = operator searches for one value. The BETWEEN operator searches
for a range between two values. Use one or the other, not both. You
also have an extra pair of uneeded quotes at the end:

stLinkCriteria = "[TransactionDate] Between #" &
Me.Beginning_Trans_Date & "# and #" & Me.Ending_Trans_Date & "#"

John W. Vinson[MVP]
 
Top