How can I change text in a report from code in a form.

  • Thread starter Add/Append Current Resident to Labels
  • Start date
A

Add/Append Current Resident to Labels

I have Start_Date and End_Date text boxes in a report. These needs to be
changed based on where clause passed from a form to run this report. Please
advise how can these be changed/filled based on user selected dates from the
code in the form.

Dim strDocName As String
strDocName = "Elapsed Days"
'runs the report based on selected dates
DoCmd.OpenReport strDocName, acViewPreview, "[TOTALS.CheckEnteredDate
Between]'" & Me.Starting_Date_Box & "and" & Me.Ending_Date_Box

Question: How to change text in report Header based on these dates. Thanks
 
M

Marshall Barton

Add/Append Current Resident to Labels said:
I have Start_Date and End_Date text boxes in a report. These needs to be
changed based on where clause passed from a form to run this report. Please
advise how can these be changed/filled based on user selected dates from the
code in the form.

Dim strDocName As String
strDocName = "Elapsed Days"
'runs the report based on selected dates
DoCmd.OpenReport strDocName, acViewPreview, "[TOTALS.CheckEnteredDate
Between]'" & Me.Starting_Date_Box & "and" & Me.Ending_Date_Box

Question: How to change text in report Header based on these dates. Thanks


If the form is the only way to open the report, then you can
use an expression in the report text box to retrieve the
values from the form. E.g.

=Forms!theform.Starting_Date_Box & " to " &
Forms!theform..Ending_Date_Box
 

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