Diggy,
You mean you have a couple of unbound textboxes on the form, for the
beginning and ending dates? Please set the Format property of these
textboxes to a date format (for example mm/dd/yyyy) to make it clear to
Access that it should treat it as a date. And then, in the criteria of
your date field in the query, the equivalent of this...
Between [Forms]![NameOfForm]![FromTextbox] And
[Forms]![NameOfForm]![ToTextbox]

Signature
Steve Schapel, Microsoft Access MVP
> I'm real close here. I followed your recipe. If I enter a date such as
> 11/17/06 or 11/17/2006, and press my "OK' button, the macro runs, but no
> data appear in my spreadsheet. Also, I have to use date ranges, such as
> ">=11/17/06 and <11/27/06". You've been kind enough to get me this far.
> Any ideas?
Diggy - 29 Nov 2006 22:10 GMT
> Diggy,
>
[quoted text clipped - 5 lines]
> Between [Forms]![NameOfForm]![FromTextbox] And
> [Forms]![NameOfForm]![ToTextbox]
Steve,
Bingo! Worked great! I think the key to the empty dataset was the Format
property of the text boxes needing to be set to (in my case)
ShortDate (stoopid me). One last question? Can I have the form also close
after I press the "OK" button? How?
Many, many thanks.
Diggy
Steve Schapel - 29 Nov 2006 22:31 GMT
> ... One last question?
Yeah, right. I've heard that one before ;-)
> Can I have the form also close
> after I press the "OK" button? How?
Yep. Just add a Close action at the end of the macro.
> Many, many thanks.
You're very welcome. Best wishes for the rest of the project.

Signature
Steve Schapel, Microsoft Access MVP