Displaying of Date Parameters

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

On a form called SFI Reports I have a textbox called BegDate and another one
called EndDate, both with a Short Date format and =Now() as thier default
values. When a date is placed in both of these textboxes and a Run Report
button is clicked, the query looks at the dates that were entered in the
BegDate and EndDate textboxes and finds records between these two dates.

I would like to have a textbox on the report that auto fills with the dates
that were entered in the BegDate and EndDate texboxes. How do I code this?
 
On a form called SFI Reports I have a textbox called BegDate and another one
called EndDate, both with a Short Date format and =Now() as thier default
values. When a date is placed in both of these textboxes and a Run Report
button is clicked, the query looks at the dates that were entered in the
BegDate and EndDate textboxes and finds records between these two dates.

I would like to have a textbox on the report that auto fills with the dates
that were entered in the BegDate and EndDate texboxes. How do I code this?

1) I would suggest that you not use Now() as criteria as Now()
includes a Time value. You may get different records returned than
expected as your query will be looking for dates from, for example,
2/1/2006 04:15:25 PM if that was the time you ran the query instead of
2/1/2006. Use Date() instead.

2) Add an unbound control to the report header.
Set it's control source to:
="For sales between " & Format(forms![SFI
Reports]!BegDate],"mm/d/yyyy") & " and " & Format(forms![SFI
Reports]![EndDate],"mm/d/yyyy")
 
If the form is still open then you can try

="Between " & Forms![SFI]![BegDate] & " And " & Forms![SFI]![EndDate]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top