These two are alternatives, if you have one, you do not need the other.
[Blue]Background[/Blue]
Let us say that you have a an unbound form called frmForm, which has two text boxes called txtStart and txtEnd, both formatted as dates.
[blue]Option 1[/blue]
Let us say that in additon to frmForm, you have a report called rptRepotOn and on frmForm you have a command button called cmdPreview. The code behind cmdPreview would be:
Code:
Private Sub cmdPreview_Click()
stDocName = "rptReport"
DoCmd.OpenReport stDocName, acPreview, , "[Date of Exam] Between " & Me.txtStart & " And " & Me.txtEnd
End Sub
[Date of Exam] is the name of the field that holds exam dates.
[blue]Option 2[/blue]
Create a query from the table you wish to use for a report and add:
[tt]Between Forms!frmForm!txtStart And Forms!frmForm!txtEnd[/tt]
To the criteria line of the form, under the exam dates field.
Fill in the form and open the query. If all is well, use this query to build a report. The report will only work properly when the form is open.
You will find a great deal of information, if you visit the Access Reports forum that I mentioned in my first post.