D
DG
Ok this is driving me nuts: I have 9 records in the clients table, based on
the group code in the rs!RptG field the appropriate reports should print per
client. I can only get the first 3 records to print...ahhhhh.
I don't understand??.........And as always thanks for your help in advance.
Function GrpRpt()
Dim db As Database
Dim rs As Recordset
Set db = CurrentDb()
Set rs = db.OpenRecordset("tblclient")
Do While Not rs.EOF
If rs.EOF = False Then
Select Case rs!RptG
Case 1
DoCmd.OpenReport "rpt4", acViewPreview, , "AutoId =" & rs!AutoId
DoCmd.OpenReport "rpt3", acViewPreview, , "AutoId =" & rs!AutoId
Case 2
DoCmd.OpenReport "rpt2", acViewPreview, , "AutoId =" & rs!AutoId
Case 3
DoCmd.OpenReport "rpt1", acViewPreview, , "AutoId =" & rs!AutoId
Case 0
Debug.Print " Report Failed " & rs!AutoId & " " & rs!LastN;
End Select
End If
rs.MoveNext
Loop
End Function
Client Table
AutoId
LastN
FirstN
RptG
1
SMITH
JAMES
1
2
JOHNSON
JOHN
2
3
WILLIAMS
ROBERT
3
4
JONES
MICHAEL
3
5
BROWN
WILLIAM
2
6
DAVIS
DAVID
3
7
MILLER
RICHARD
2
8
WILSON
CHARLES
3
9
MOORE
JOSEPH
1
the group code in the rs!RptG field the appropriate reports should print per
client. I can only get the first 3 records to print...ahhhhh.
I don't understand??.........And as always thanks for your help in advance.
Function GrpRpt()
Dim db As Database
Dim rs As Recordset
Set db = CurrentDb()
Set rs = db.OpenRecordset("tblclient")
Do While Not rs.EOF
If rs.EOF = False Then
Select Case rs!RptG
Case 1
DoCmd.OpenReport "rpt4", acViewPreview, , "AutoId =" & rs!AutoId
DoCmd.OpenReport "rpt3", acViewPreview, , "AutoId =" & rs!AutoId
Case 2
DoCmd.OpenReport "rpt2", acViewPreview, , "AutoId =" & rs!AutoId
Case 3
DoCmd.OpenReport "rpt1", acViewPreview, , "AutoId =" & rs!AutoId
Case 0
Debug.Print " Report Failed " & rs!AutoId & " " & rs!LastN;
End Select
End If
rs.MoveNext
Loop
End Function
Client Table
AutoId
LastN
FirstN
RptG
1
SMITH
JAMES
1
2
JOHNSON
JOHN
2
3
WILLIAMS
ROBERT
3
4
JONES
MICHAEL
3
5
BROWN
WILLIAM
2
6
DAVIS
DAVID
3
7
MILLER
RICHARD
2
8
WILSON
CHARLES
3
9
MOORE
JOSEPH
1