Lostsouljer
Technical User
I Have created a report that is obtaining its parameters from a form, which in turn then runs a query, the problem i am having is that after you enter the parameters into the form (a start date and end date), two text boxes pop up asking you to enter the startdate and enddate for the query (which is exactly the same as what has just been entered for the form. I can see the query has already been run from the parameters from the form as it pops up in the background with all the appropriate information, yet it is still asking me to re enter in the parameters) What am i doing wrong??Below is the code that i got off the Microsoft website help.
This is the code i am using for the query
Between [Forms]![Sort by workshop date]![StartDate] And [Sort by workshop date]![EndDate]
This is the code for the Form
Private Sub cmdOk_Click()
Me.Visible = False
DoCmd.OpenQuery "Appointments period", acViewNormal, acEdit
DoCmd.Close acForm, "Sort by workshop date"
End Sub
and this is in the report
Private Sub Report_Close()
DoCmd.Close acForm, "Sort by workshop date"
End Sub
Private Sub Report_Open(Cancel As Integer)
' Set public variable to true to indicate that the report
' is in the Open event
bInReportOpenEvent = True
' Open Sales By Category Dialog
DoCmd.OpenForm "Sort by workshop date", , , , , acDialog
' Cancel Report if User Clicked the Cancel Button
' If IsLoaded("Sort by workshop date") = False Then Cancel = True
' Set public variable to false to indicate that the
' Open event is completed
bInReportOpenEvent = False
End Sub
Any help would be greatly appreciated
This is the code i am using for the query
Between [Forms]![Sort by workshop date]![StartDate] And [Sort by workshop date]![EndDate]
This is the code for the Form
Private Sub cmdOk_Click()
Me.Visible = False
DoCmd.OpenQuery "Appointments period", acViewNormal, acEdit
DoCmd.Close acForm, "Sort by workshop date"
End Sub
and this is in the report
Private Sub Report_Close()
DoCmd.Close acForm, "Sort by workshop date"
End Sub
Private Sub Report_Open(Cancel As Integer)
' Set public variable to true to indicate that the report
' is in the Open event
bInReportOpenEvent = True
' Open Sales By Category Dialog
DoCmd.OpenForm "Sort by workshop date", , , , , acDialog
' Cancel Report if User Clicked the Cancel Button
' If IsLoaded("Sort by workshop date") = False Then Cancel = True
' Set public variable to false to indicate that the
' Open event is completed
bInReportOpenEvent = False
End Sub
Any help would be greatly appreciated