Hello socoolbrewster
Everything is possible...if you know how! What you need, I do all the time. There are many flavours of the technique so here's the general idea.
Add a label control in a section of your report and name it (here it is lblTheDates).
In the OnOpen event of the report add some code like this (adapting it to your situation):
Private Sub Report_Open(Cancel As Integer)
Dim frm As Form
Set frm = Forms("frmYourInputForm")
Me!lblTheDates.Caption = "From " & _
Format(frm.txtDateFrom, "dd-mmmm-yy") & " to " & _
Format(frm.txtDateTo, "dd-mmmm-yy")
End Sub
So, when the report opens (the form is still open) it creates an object variable frm pointing to the opened form frmYourInputForm. Then it reads the two dates in the TextBoxes txtDateFrom and txtDateTo on the form and concatenates the whole thing is a sentence.
So if the first box has 2/12/05 and the second one has 3/21/05 the procedure will write in the Caption of the Label:
From 12-February-05 to 21-March-05
You will have fun, though, validating the two entries to make sure they are dates or even that the two text boxes contain something.
Let me know about your progress.
Daniel
|