I think i might be using the wrong code for the OnOpen/OnClose events
in the report prob code for newer versions can you help with code that
i need as it... what i have is
Form code:
Option Compare Database
Private Sub Cancel_Click()
DoCmd.Close
End Sub
Private Sub Form_Open(Cancel As Integer)
If Not bInReportOpenEvent Then
' If we're not called from the report
MsgBox "For use from the Sales By Category Report only", vbOKOnly
Cancel = True
End If
Form_Open_Exit:
Exit Sub
End Sub
Private Sub OK_Click()
Me.Visible = False
End Sub
Report code:
Option Compare Database
Private Sub Report_Close()
DoCmd.Close acForm, "Sales By Category Dialog"
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 "Sales By Category Dialog", , , , , acDialog
' Cancel Report if User Clicked the Cancel Button
If IsLoaded("Sales By Category Dialog") = False Then Cancel = True
' Set public variable to false to indicate that the
' Open event is completed
bInReportOpenEvent = False
End Sub
and in the querys i have:
Criteria for School Name ----> [Forms]![MealUptake]![School]
Criteria for Date ---->> Between [Forms]![Meal Uptake]![StartDate] And
[Forms]![MealUptake]![EndDate]
any ideas... on the good side.. i aint getting that errror with the
module LoL...
