B
Bob
This is my code to print a statement by selecting date range and OwnerName,
at the bottom of the code there is something about batch printing
statements but it is greened out. Can I use this for batch printing all
owners staements at todays date? Thanks for your Help......Bob
Private Sub cmdStatement_Click()
Select Case Me.OpenArgs
Case "OwnerStatement"
If IsNull(cbOwnerName.value) = True Or cbOwnerName.value =
vbNullString Then
MsgBox "Please Select the Owner.", vbApplicationModal +
vbInformation + vbOKOnly
Exit Sub
End If
Me.Visible = False
DoCmd.OpenReport "rptOwnerPaymentMethod", acViewPreview
'DoCmd.Close acForm, Me.Name
Case "MonthlyPaid"
Me.Visible = False
DoCmd.OpenReport "rptGenericReport", acViewPreview, , , ,
"MonthlyPaid"
'Report_rptGenericReport.tbTotal.value =
SUM(Report_rptGenericReport.tbAmount)
'DoCmd.Close acForm, Me.Name
'Report_rptGenericReport.tbTotal =
DSum(Report_rptGenericReport.tbAmount, "rptGenericReport")
'Report_rptGenericReport.tbTotal.ControlSource =
"Sum(Report_rptGenericReport.tbAmount)"
DoCmd.Close acForm, Me.Name
Case "OwnerDue"
Me.Visible = False
DoCmd.OpenReport "rptGenericReport", acViewPreview, , , ,
"OwnerDue"
DoCmd.Close acForm, Me.Name
Case "OwnerPaymentMethod"
If IsNull(cbOwnerName.value) = True Or cbOwnerName.value =
vbNullString Then
MsgBox "Please Select the Owner.", vbApplicationModal +
vbInformation + vbOKOnly
Exit Sub
End If
Me.Visible = False
DoCmd.OpenReport "rptGenericReport", acViewPreview, , , ,
"OwnerPaymentMethod"
DoCmd.Close acForm, Me.Name
Case "PaymentMethod"
Dim nDateDiff As Integer, nSign As Integer
nDateDiff = DateDiff("d", CDate(tbDateFrom.value),
CDate(tbDateTo.value))
nSign = Sgn(nDateDiff)
If nSign = -1 Or nSign = 0 Then
MsgBox "Please Select Date In Proper Range.",
vbApplicationModal + vbExclamation + vbOKOnly
cmdCalenderTo.SetFocus
Exit Sub
End If
Me.Visible = False
DoCmd.OpenReport "rptGenericReport", acViewPreview, , , ,
"PaymentMethod"
DoCmd.Close acForm, Me.Name
Case "PrintInvoiceBatch"
If IsNull(tbDateFrom.value) Or tbDateFrom.value = "" Or
IsNull(tbDateTo.value) Or tbDateTo.value = "" Then
MsgBox "Please Enter the Begining Date and End Date.",
vbApplicationModal + vbInformation + vbOKOnly
Exit Sub
End If
Me.Visible = False
DoCmd.OpenReport "rptInvoiceBatch", acViewPreview, , , ,
"PrintInvoiceBatch"
'DoCmd.Close acForm, Me.Name
Case "PrintStatementBatch"
' If IsNull(tbDateFrom.value) Or tbDateFrom.value = "" Or
IsNull(tbDateTo.value) Or tbDateTo.value = "" Then
' MsgBox "Please Enter the Begining Date and End Date.",
vbApplicationModal + vbInformation + vbOKOnly
' Exit Sub
' End If
Me.Visible = False
DoCmd.OpenReport "rptOwnerPaymentMethodBatch", acViewPreview, , , ,
"PrintStatementBatch"
'DoCmd.Close acForm, Me.Name
End Select
'DoCmd.OpenReport "rptInvoiceBatch", acViewPreview, , , ,
"PrintInvoiceBatch"
End Sub
at the bottom of the code there is something about batch printing
statements but it is greened out. Can I use this for batch printing all
owners staements at todays date? Thanks for your Help......Bob
Private Sub cmdStatement_Click()
Select Case Me.OpenArgs
Case "OwnerStatement"
If IsNull(cbOwnerName.value) = True Or cbOwnerName.value =
vbNullString Then
MsgBox "Please Select the Owner.", vbApplicationModal +
vbInformation + vbOKOnly
Exit Sub
End If
Me.Visible = False
DoCmd.OpenReport "rptOwnerPaymentMethod", acViewPreview
'DoCmd.Close acForm, Me.Name
Case "MonthlyPaid"
Me.Visible = False
DoCmd.OpenReport "rptGenericReport", acViewPreview, , , ,
"MonthlyPaid"
'Report_rptGenericReport.tbTotal.value =
SUM(Report_rptGenericReport.tbAmount)
'DoCmd.Close acForm, Me.Name
'Report_rptGenericReport.tbTotal =
DSum(Report_rptGenericReport.tbAmount, "rptGenericReport")
'Report_rptGenericReport.tbTotal.ControlSource =
"Sum(Report_rptGenericReport.tbAmount)"
DoCmd.Close acForm, Me.Name
Case "OwnerDue"
Me.Visible = False
DoCmd.OpenReport "rptGenericReport", acViewPreview, , , ,
"OwnerDue"
DoCmd.Close acForm, Me.Name
Case "OwnerPaymentMethod"
If IsNull(cbOwnerName.value) = True Or cbOwnerName.value =
vbNullString Then
MsgBox "Please Select the Owner.", vbApplicationModal +
vbInformation + vbOKOnly
Exit Sub
End If
Me.Visible = False
DoCmd.OpenReport "rptGenericReport", acViewPreview, , , ,
"OwnerPaymentMethod"
DoCmd.Close acForm, Me.Name
Case "PaymentMethod"
Dim nDateDiff As Integer, nSign As Integer
nDateDiff = DateDiff("d", CDate(tbDateFrom.value),
CDate(tbDateTo.value))
nSign = Sgn(nDateDiff)
If nSign = -1 Or nSign = 0 Then
MsgBox "Please Select Date In Proper Range.",
vbApplicationModal + vbExclamation + vbOKOnly
cmdCalenderTo.SetFocus
Exit Sub
End If
Me.Visible = False
DoCmd.OpenReport "rptGenericReport", acViewPreview, , , ,
"PaymentMethod"
DoCmd.Close acForm, Me.Name
Case "PrintInvoiceBatch"
If IsNull(tbDateFrom.value) Or tbDateFrom.value = "" Or
IsNull(tbDateTo.value) Or tbDateTo.value = "" Then
MsgBox "Please Enter the Begining Date and End Date.",
vbApplicationModal + vbInformation + vbOKOnly
Exit Sub
End If
Me.Visible = False
DoCmd.OpenReport "rptInvoiceBatch", acViewPreview, , , ,
"PrintInvoiceBatch"
'DoCmd.Close acForm, Me.Name
Case "PrintStatementBatch"
' If IsNull(tbDateFrom.value) Or tbDateFrom.value = "" Or
IsNull(tbDateTo.value) Or tbDateTo.value = "" Then
' MsgBox "Please Enter the Begining Date and End Date.",
vbApplicationModal + vbInformation + vbOKOnly
' Exit Sub
' End If
Me.Visible = False
DoCmd.OpenReport "rptOwnerPaymentMethodBatch", acViewPreview, , , ,
"PrintStatementBatch"
'DoCmd.Close acForm, Me.Name
End Select
'DoCmd.OpenReport "rptInvoiceBatch", acViewPreview, , , ,
"PrintInvoiceBatch"
End Sub