jodstrr2
asked on
Print problem
Hi Experts,
I'm having a print problem. Here is my problem, I want the system to print one calendar at a time. For example, I have calendar Q and Calendar S on the same criteria that I entered. I want to Calendar Q print out 7 pages then Calendar S print out 7 pages instead first page is Calendar Q and 2nd page is Calendars then 3rd page is Calendar Q and 4th page is Calendar S etc.
Below is my coding and the coding only print the first record which means only print 7 page of the Calendar Q and did not print the Calendar S. Any help will be appreciate.
Private Sub Continue_Click()
On Error GoTo Err_Continue_Click
Dim stDocName As String
Dim stCriteria As String
Form_frmWhichTransmittal.B atchID = Me.BatchID
Form_frmWhichTransmittal.C OURTDATE = Me.COURTDATE
Form_frmWhichTransmittal.F iledDate = Me.FiledDate
Cal = DLookup("Calendar", "qryAliasSummons/SummonsTr ansmittal" )
COURTDATE = DLookup("PDAPPEAR", "qryAliasSummons/SummonsTr ansmittal" )
Select Case WhichTransmittal
Case 1
Form_frmPrintedReportsAll. LabelMessa ge = "TRANSMITTAL FOR ALIAS SUMMONS"
Case 2
Form_frmPrintedReportsAll. LabelMessa ge = "TRANSMITTAL FOR SUMMONS"
End Select
If IsNull(BatchID) Or IsNull(COURTDATE) Or IsNull(FiledDate) Then
MsgBox "Please enter BatchID, Appearance Date and Date Filed before proceeding."
Exit Sub
Else
If Form_frmPrintedReportsAll. LabelMessa ge = "TRANSMITTAL FOR ALIAS SUMMONS" Then
stDocName = "rptAliasSummons/SummonsTr ansmittal"
DoCmd.OpenReport stDocName, acPreview, , "CALENDAR = '" & Me.Cal & "' and PDAPPEAR = #" & Me.COURTDATE & "#"
DoCmd.SelectObject acReport, stDocName, False
DoCmd.PrintOut acPrintAll, , , , 7
DoCmd.Close acReport, stDocName
Else
stDocName = "rptAliasSummons/SummonsTr ansmittal"
DoCmd.OpenReport stDocName, acPreview, , "CALENDAR = '" & Me.Cal & "' and PDAPPEAR = #" & Me.COURTDATE & "#"
DoCmd.SelectObject acReport, stDocName, False
DoCmd.PrintOut acPrintAll, , , , 8
DoCmd.Close acReport, stDocName
End If
End If
Exit_Continue_Click:
DoCmd.Close acForm, "frmWhichTransmittal"
Exit Sub
Err_Continue_Click:
MsgBox Err.DESCRIPTION
Resume Exit_Continue_Click
End Sub
I'm having a print problem. Here is my problem, I want the system to print one calendar at a time. For example, I have calendar Q and Calendar S on the same criteria that I entered. I want to Calendar Q print out 7 pages then Calendar S print out 7 pages instead first page is Calendar Q and 2nd page is Calendars then 3rd page is Calendar Q and 4th page is Calendar S etc.
Below is my coding and the coding only print the first record which means only print 7 page of the Calendar Q and did not print the Calendar S. Any help will be appreciate.
Private Sub Continue_Click()
On Error GoTo Err_Continue_Click
Dim stDocName As String
Dim stCriteria As String
Form_frmWhichTransmittal.B
Form_frmWhichTransmittal.C
Form_frmWhichTransmittal.F
Cal = DLookup("Calendar", "qryAliasSummons/SummonsTr
COURTDATE = DLookup("PDAPPEAR", "qryAliasSummons/SummonsTr
Select Case WhichTransmittal
Case 1
Form_frmPrintedReportsAll.
Case 2
Form_frmPrintedReportsAll.
End Select
If IsNull(BatchID) Or IsNull(COURTDATE) Or IsNull(FiledDate) Then
MsgBox "Please enter BatchID, Appearance Date and Date Filed before proceeding."
Exit Sub
Else
If Form_frmPrintedReportsAll.
stDocName = "rptAliasSummons/SummonsTr
DoCmd.OpenReport stDocName, acPreview, , "CALENDAR = '" & Me.Cal & "' and PDAPPEAR = #" & Me.COURTDATE & "#"
DoCmd.SelectObject acReport, stDocName, False
DoCmd.PrintOut acPrintAll, , , , 7
DoCmd.Close acReport, stDocName
Else
stDocName = "rptAliasSummons/SummonsTr
DoCmd.OpenReport stDocName, acPreview, , "CALENDAR = '" & Me.Cal & "' and PDAPPEAR = #" & Me.COURTDATE & "#"
DoCmd.SelectObject acReport, stDocName, False
DoCmd.PrintOut acPrintAll, , , , 8
DoCmd.Close acReport, stDocName
End If
End If
Exit_Continue_Click:
DoCmd.Close acForm, "frmWhichTransmittal"
Exit Sub
Err_Continue_Click:
MsgBox Err.DESCRIPTION
Resume Exit_Continue_Click
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Actually, if this is being done in a report, the sort order and grouping of the query have little to do with it. The Sorting and Grouping setup in the report control the grouping and ordering (if there are any). So you might want to open the report in design view, select the Group & Sort button on the Design Ribbon (2007) and setup groups and sorting, as appropriate.
I do not see where you assign a value to the variable WhichTransmital?
you expect ONE calendar to print.
However the "Report" recordsource may be drawing all the data and have a sort by month or other field and not a "Calendar type" so the report will print in month order C S C S C S.
Check your report recordsource query and see how the query is set up.
Without actually having a sample MDB it would be difficult to be totally correct.
Don