Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DoCmd Criteria

Status
Not open for further replies.

traceytr

Programmer
Mar 13, 2001
94
US
Hi. I'm new to VBA, and I cannot find the answer to the following puzzle. When I run this code, I'm prompted to enter MyDate and Today. (No wrappiing in my DoCmd line.) Why does it not use the dates assigned to the variables? Thanks. Tracey


MyDate = (Date - 60)
Today = (Date + 1)

DoCmd.OpenForm "frmLPL", acNormal, , "[FaxReceived] BETWEEN MyDate and Today", acFormEdit, acWindowNormal
 
How are ya traceytr . . .

. . . and this:
Code:
[blue]   Dim Criteria As String
   
   MyDate = (Date - 60)
   Today = (Date + 1)
   Criteria = "[FaxReceived] BETWEEN #" & MyDate & "# AND #" & Today & "#"
    
    DoCmd.OpenForm "frmLPL", acNormal, , Criteria, acFormEdit, acWindowNormal[/blue]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top