I am self-thought and beginner for access, and VBA. Database I'm creating has 2 forms and both built on same query, one of which will be used by users to enter data and other to pull report from the same query. I based criteria on my query on the 2nd form to filter data on the report. Now the problem is that ever time the first form is run, I get dialog box requiring users to enter parameters which is not necessary for data input. How can I get around that? Do I need to create another query for the report?
Thank you all.
Criteria in query: [forms]![FrmRptGrpLog]![txtStartDt] And [Forms]![FrmRptGrpLog]![TxtEndDt]
VBA for 2nd form to run the report
Code:
Private Sub CmdGrpRpt_Click()
DoCmd.SetWarnings Flase
Me.txtStartDt.SetFocus
DoCmd.OpenQuery ("QryGroupLog")
DoCmd.OpenReport ("RptGroupLog"), acViewPreview
DoCmd.Close acForm, "frmrptGrpLog"
DoCmd.SetWarnings True
End Sub