Print Date Parameter from a popup form into the report header

F

FA

Hi Freinds, I am stuck at somewhere and need help. I have a report and
in the report Open Event i have the codes like this
Private Sub Report_Open(Cancel As Integer)
DoCmd.OpenForm "frmReportDateRange", , , , , acDialog, "Risks
Assesments Finding Report"
End Sub
Where frmReportDateRange is a form that i created to input the date
range using calanders.
The datasource for this report is a query created in MS Access called
qryNumberofHighMediumLows. In the where clause of TEST_END_DATE i have
the following code.
WHERE
(((dbo_SYS_INFO.TEST_END_DATE)>=[Forms]![frmReportDateRange]![Begining
Report Date] And
(dbo_SYS_INFO.TEST_END_DATE)<=[Forms]![frmReportDateRange]![Ending
Report Date])).
Now when the user run the report frmReportDateRange pops up where the
user enter the begin and end date. I want these two date to be print in
the report header. I tried to add a text box in the report header using
MS sample report database.
="Report Period From" & " " & [Enter Start Date] & " " & "Through" & "
" & [Enter End Date]
This is the code in the text box.
But when i run the report it opens the frmReportDateRange and when i
enter the date range in that form, a parameter form pops up and ask me
the to enter the date again which i dont want. I want the daterange
form pop up once only.

Can someone help me please.

Moe
 
M

Marshall Barton

FA said:
Hi Freinds, I am stuck at somewhere and need help. I have a report and
in the report Open Event i have the codes like this
Private Sub Report_Open(Cancel As Integer)
DoCmd.OpenForm "frmReportDateRange", , , , , acDialog, "Risks
Assesments Finding Report"
End Sub
Where frmReportDateRange is a form that i created to input the date
range using calanders.
The datasource for this report is a query created in MS Access called
qryNumberofHighMediumLows. In the where clause of TEST_END_DATE i have
the following code.
WHERE
(((dbo_SYS_INFO.TEST_END_DATE)>=[Forms]![frmReportDateRange]![Begining
Report Date] And
(dbo_SYS_INFO.TEST_END_DATE)<=[Forms]![frmReportDateRange]![Ending
Report Date])).
Now when the user run the report frmReportDateRange pops up where the
user enter the begin and end date. I want these two date to be print in
the report header. I tried to add a text box in the report header using
MS sample report database.
="Report Period From" & " " & [Enter Start Date] & " " & "Through" & "
" & [Enter End Date]
This is the code in the text box.
But when i run the report it opens the frmReportDateRange and when i
enter the date range in that form, a parameter form pops up and ask me
the to enter the date again which i dont want. I want the daterange
form pop up once only.


The parameters you are using in the text box:
[Enter Start Date]
will cause the prompt box to appear.
That is different from the parameters you are using in the
query:
[Forms]![frmReportDateRange]![Begining Report Date]
which gets its value from your dialog form.

Change the text box expression to use the form references.

Note that the dialog form must stay open until the report
closes.
 

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

Top