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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BETWEEN [start date] AND [ending date] 2

Status
Not open for further replies.

Dewey

Programmer
Jan 25, 2000
21
US
this may be easy but i've missed it...<br>
<br>
I am using the query criteria to input 2 dates via the parameter screen, which are [start date], [ending date]. The query runs fine, but I can not figure out how to get these dates set to a variable to print on the form in a label or textbox. Every time I get an error message...<br>
any help or code would be appreciated....thks.<br>
<p>Dewey Davis<br><a href=mailto:ddavis@dfn.com>ddavis@dfn.com</a><br><a href= > </a><br>
 
Dewey, <br>
These can be put in a Row of the query as well, ie you can just put [start date] and [end date] in a new column on the query, and you'll still only enter the value once, and this row is available at any time by referring to that 'field', ie in a new query Column:<br>
<br>
SDATE: [start date] &lt;---=this param is also in Criteria.<br>
<br>
This does not create a processing slowdown, since it is evaluated once, and just copied into every row.<br>
--Jim
 
Another way is to pop up an InputBox from your report or form's OnOpen event and let the user enter the dates on it. Then you can refer to this form's fields on your resulting form or report.<br>
<br>
Reportname!Fieldname = Forms!InputFormName!InputFieldNameStartDate<br>
Reportname!Fieldname = Forms!InputFormName!InputFieldNameEndDate<br>
<br>
You can also use the nifty-looking Calendar control for capturing dates (click in toolbox on &quot;more&quot;).<br>
<br>

 
Sorry, should have written &quot;a form that allows input&quot; not &quot;an InputBox&quot;.
 
Hi I am new to access but I have report that uses start date and end date so under the control source of the report I put the following code<br>
=[Forms]![formname]![StartDate]<br>
=[Forms]![forname]![EndDate]<br>
<br>
I am assuming you have a query for this form. <p>Villica<br><a href=mailto:villica67@hotmail.com>villica67@hotmail.com</a><br><a href= > </a><br>
 
Thanks for all the help... I'll keep &quot;puttering&quot; with it.. <p>Dewey Davis<br><a href=mailto:ddavis@dfn.com>ddavis@dfn.com</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top