Report Date

  • Thread starter Thread starter Todd
  • Start date Start date
T

Todd

I have a form that has 2 fields on it, txtStartDate and
txtEndDate. From these two fields I pull a report,
rpt_DistrictEvents. I would like to add on the top
header to the title, the date ranges listed in
txtStartDate and txtEndDate. Is this possible?
 
Add an unbound text box in your header. We'll call it
Text1...We will also call your form Form1 for example
purposes. With the report still in design mode, Click on
the menu View > Code and enter the following:

Private Sub Report_Open(Cancel As Integer)
Text1.setfocus
Text1.text = Forms!Form1!txtStartDate _
& " - " & _
Forms!Form1!txtEndDate
End Sub
 
Great
Thanks alot.
-----Original Message-----
Add an unbound text box in your header. We'll call it
Text1...We will also call your form Form1 for example
purposes. With the report still in design mode, Click on
the menu View > Code and enter the following:

Private Sub Report_Open(Cancel As Integer)
Text1.setfocus
Text1.text = Forms!Form1!txtStartDate _
& " - " & _
Forms!Form1!txtEndDate
End Sub


.
 
I can't imagine that this would work since you can't ever set the focus to a
REPORT control. This would work if this was a form but it wouldn't be
necessary to set the focus to the control. You could use:
Me.Text1 = Forms!Form1!txtStartDate _
& " - " & _
Forms!Form1!txtEndDate

Back to your report...
Create a text box with a control source of:
=Forms!Form1!txtStartDate & " - " & Forms!Form1!txtEndDate
 
Back
Top