B
buscher75
I have a form, frmWeight, I use to enter in a date range, txtStart and
txtEnd. On click of the run report button, I want to run two queries, weight
and weight2, and open a report, rptWeight.
The way the code is currently written does not work. It seems as though a
strWhere condition would apply here (from what I have read) but I do not know
how to write the code. I have tried a few examples in the past but have had
no success.
Any help would be appreciated. Here is the code I have.
Private Sub CommandWeight_Click()
On Error GoTo Err_CommandWeight_Click
Dim strReport As String 'Name of report to open.
strReport = "rptWeight"
DoCmd.OpenReport strReport, acViewPreview
Exit_CommandWeight_Click:
Exit Sub
Err_CommandWeight_Click:
MsgBox Err.Description
Resume Exit_CommandWeight_Click
End Sub
txtEnd. On click of the run report button, I want to run two queries, weight
and weight2, and open a report, rptWeight.
The way the code is currently written does not work. It seems as though a
strWhere condition would apply here (from what I have read) but I do not know
how to write the code. I have tried a few examples in the past but have had
no success.
Any help would be appreciated. Here is the code I have.
Private Sub CommandWeight_Click()
On Error GoTo Err_CommandWeight_Click
Dim strReport As String 'Name of report to open.
strReport = "rptWeight"
DoCmd.OpenReport strReport, acViewPreview
Exit_CommandWeight_Click:
Exit Sub
Err_CommandWeight_Click:
MsgBox Err.Description
Resume Exit_CommandWeight_Click
End Sub