I have used recordset in detail print event for some fields in report which shows records in preview but not print
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset(vstr, dbOpenSnapshot)
With rs
If .RecordCount = 0 Then Exit Sub
dt1.Caption = .Fields("Date") & ". GRN#." & .Fields("VocNo") & ". IGP#." & .Fields("IGP")
rt1.Caption = .Fields("Rate")
pt1.Caption = .Fields("LParty")
.MoveNext
Do While Not .EOF
Select Case .AbsolutePosition
Case 1
dt2.Caption = .Fields("Date") & ". GRN#." & .Fields("VocNo") & ". IGP#." & .Fields("IGP")
rt2.Caption = .Fields("Rate")
pt2.Caption = .Fields("LParty")
End Select
.MoveNext
Loop
End With
End Sub
Please suggest me solution to this problem.
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset(vstr, dbOpenSnapshot)
With rs
If .RecordCount = 0 Then Exit Sub
dt1.Caption = .Fields("Date") & ". GRN#." & .Fields("VocNo") & ". IGP#." & .Fields("IGP")
rt1.Caption = .Fields("Rate")
pt1.Caption = .Fields("LParty")
.MoveNext
Do While Not .EOF
Select Case .AbsolutePosition
Case 1
dt2.Caption = .Fields("Date") & ". GRN#." & .Fields("VocNo") & ". IGP#." & .Fields("IGP")
rt2.Caption = .Fields("Rate")
pt2.Caption = .Fields("LParty")
End Select
.MoveNext
Loop
End With
End Sub
Please suggest me solution to this problem.