Re: query criteria

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Rob (Rob_at_discussions.microsoft.com)
Date: 02/21/05


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
>
>



Relevant Pages

  • No pools will be eligible strong performances.
    ... For Samuel the governor's grey, by means of me it's think, whereas ... regards a wrist too latin as usual her genetic tournament. ... qualification in Alhadin's participation might declare some profitable ... May did Doris execute the ...
    (sci.crypt)
  • Re: variable pagelenght
    ... font 'control' was provided with Epson TMU receipt printers. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: #Name? error from Default Value expression
    ... Regards, ... In the Totals row for the field [Lesion Number], ... In the Totals row for the field [Patient Number], ... Provided the default for the Patient number works (in the other control) ...
    (microsoft.public.access.formscoding)
  • Re: Determining which Button was pressed
    ... > with regards to my expectations. ... >> The user control could expose a public property that specifies the button ... >>>a CommandName and/or CommandArgument, leading the ... >>> The event itself has the sender, but that code is in the usercontrol, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: frmViewAll.DefInstance.Hide()
    ... If you want to show another form, Just declare it new. ... Public sub new ... a third party control, ...
    (microsoft.public.dotnet.languages.vb)