Re: query criteria
From: Rob (Rob_at_discussions.microsoft.com)
Date: 02/21/05
- Next message: anonymous_at_discussions.microsoft.com: "Re: Format Query"
- Previous message: Alex: "Error in query ??"
- In reply to: Barry-Jon: "Re: query criteria"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 21 Feb 2005 11:17:03 -0800
It WORKS!. I can't believe it. Thank you, Thank you.
Ironically, it was the last tip that did it. I had theorized that it was
possible to add the form fields to the parameter, but had not opened the form
before running the query, so it didn't work.
Thanks again, especially for not assuming that I knew better.
"Barry-Jon" wrote:
> Hi Rob,
>
> Yes you can do this. I mocked it up with Form1 with text boxes
> txtDatefrm & txtDateto. The query would then look like this:
>
> PARAMETERS [Forms]![Form1]![txtDatefrm] DateTime,
> [Forms]![Form1]![txtDateto] DateTime;
> SELECT TableName.entrymo, TableName.entryyr
> FROM TableName
> WHERE
> (((DateSerial([entryyr],[entrymo],1))>=[Forms]![Form1]![txtDatefrm] And
> (DateSerial([entryyr],[entrymo],1))<=[Forms]![Form1]![txtDateto]));
>
> As you can see you just declare the parameter as being the control on
> the form. Though I am sure you already know the form has to be open
> for this query to work. Good luck and let me know how it goes :-)
>
> Regards
>
> Barry-Jon
>
>
- Next message: anonymous_at_discussions.microsoft.com: "Re: Format Query"
- Previous message: Alex: "Error in query ??"
- In reply to: Barry-Jon: "Re: query criteria"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|