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

Date Range to Display in Report 2

Status
Not open for further replies.

bethabernathy

Programmer
Jul 13, 2001
254
0
0
MX
Hi There: If it isn't one thing it is another. I have this syntax in a text box on a report:

="Reporting Dates From: " & [Enter Start Date] & " & " & [Enter End Date]

I use it to display the date range I have in my queries on the report header.

Now I have a form (thanks to CosmoKramer) where I input a date range into 2 text boxes and a command button that ultimately runs my report. But the syntax above is now prompting me to add a date range.

Is there any way to get your date range to appear on a report header without it prompting you to enter a date range?

Thank you for everything. Beth
 
Try:

="Reporting Dates From: " & forms!formName!txtDate1 & " & " & forms!formNae!txtDate2

where txtDate1 and 2 are the names of your fields in your form. Hope this is ok, please let me know.

Nick (Everton Rool OK!)
 
Replace your [Enter Start Date] & [Enter End Date] with references to your form fields: Forms!Formname!ControlName
 
Beth,

Sorry, it should read:

="Reporting Dates From: " & forms!formName!txtDate1 & " to " & forms!formNae!txtDate2

where txtDate1 and 2 are the names of your fields in your form. Hope this is ok, please let me know.

Nick (Everton Rool OK!)
 
Hi Nick:

I added this in:

="Reporting Dates From: " & [Forms]![frmdate]![begindate] & " to " & [Forms]![frmdate]![enddate]

and it is still prompting me for a date range. I am running a macro that begins with entering the date range into 2 text boxes on a form.

Beth
 
Beth,

Is frmDate still open? What does the prompt actually say? Hope this is ok, please let me know.

Nick (Everton Rool OK!)
 
Do you have the form fields referenced in your query too? Also, is frmdate being left open while you open your report?
 
Hi - When I run my macro I get a prompt:

Forms!frmdate!BeginDate

then

Forms!frmdate!endDate

The form isn't open.

Thanks Beth
 
The form needs to be kept open, ideally until you close the report. Hope this is ok, please let me know.

Nick (Everton Rool OK!)
 
What in your macro is calling for the dates? Your query doesn't need to be open before the report, but the form does, otherwise Access has nowhere to look for the dates and will ask you for them.
 
That is correct. I had lost my mind for a minute. Thank you so much.

Beth
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top