Hi all
I am having trouble with some code for printing batch reports. I created a form with a load of tick boxes. There names are Report1, Report2 Report3 etc etc.....
I have the following code to loop through which text boxes are ticked and to preview the necessary but one line is not doing what i want it to !!
The error is Method or Data Member not found !!
The form jpeg is attached.
Could anyone help ?
I am having trouble with some code for printing batch reports. I created a form with a load of tick boxes. There names are Report1, Report2 Report3 etc etc.....
I have the following code to loop through which text boxes are ticked and to preview the necessary but one line is not doing what i want it to !!
Code:
Dim stDocName(18) As String
stDocName(1) = "rptMedicineNotEmpty"
stDocName(2) = "rptTBTest"
stDocName(3) = "rptDryingOff"
stDocName(4) = "rpt30month"
stDocName(5) = "rptFootTrimming"
stDocName(6) = "rptAnimalsON"
stDocName(7) = "rptAnimalsOFF"
stDocName(8) = "rptCalvingRecord"
stDocName(9) = "rptAIRegister"
stDocName(10) = "rptFootTrimmingRecord"
stDocName(11) = "rptMedicinePurchased"
stDocName(12) = "rptMedicineAdminDryCows"
stDocName(13) = "rptMedicineAdminMastAug"
stDocName(14) = "rptMedicineAdminFCMDR"
stDocName(15) = "rptMedicineAdminCalfYoung"
stDocName(16) = "rptMedicineAdminTestVaccWorm"
stDocName(17) = "rptMedicineAdminCowLame"
stDocName(18) = "rptMedicineAdminSheep"
If Me.ToDate < Me.FromDate Or IsNull(Me.FromDate) Or Me.FromDate = "" Then
MsgBox "Invalid date range", vbOKOnly, "Error"
Me.FromDate.SetFocus
Exit Sub
End If
For a = 1 To 18
[COLOR=red]If Me.Report(a) = True Then[/COLOR]
StartDate = Me.FromDate
EndDate = Me.ToDate
ReportName = stDocName(a)
DoCmd.OpenReport ReportName, acPreview
End If
Next a
Exit_Command5_Click:
Exit Sub
Err_Command5_Click:
MsgBox Err.Description
Resume Exit_Command5_Click
The error is Method or Data Member not found !!
The form jpeg is attached.
Could anyone help ?