stnkyminky
Programmer
I am wanting to print all the records in a database 3 times with different headings. I have accomplished this but I am having a strange problem. The table only has 7 records in it. While in the do loop I retrieve 1 records and exit the loop despite the db.project_rs.MoveNext. Why is the code exiting the loop and not retrieving the remaining records. Thanks
Do Until db.Project_rs.EOF
drInventoryTicket.Sections(3).Controls("lbltype".Caption = "FG"
drInventoryTicket.Sections(3).Controls("lblitnum".Caption = db.Project_rs("part_number"
If CInt(db.Project_rs("seqnum") <= 9 Then
drInventoryTicket.Sections(3).Controls("lblseqnum".Caption = "00000"
ElseIf CInt(db.Project_rs("seqnum") <= 99 Then
drInventoryTicket.Sections(3).Controls("lblseqnum".Caption = "0000"
ElseIf CInt(db.Project_rs("seqnum") <= 999 Then
drInventoryTicket.Sections(3).Controls("lblseqnum".Caption = "000"
ElseIf CInt(db.Project_rs("seqnum") <= 9999 Then
drInventoryTicket.Sections(3).Controls("lblseqnum".Caption = "00"
ElseIf CInt(db.Project_rs("seqnum") <= 99999 Then
drInventoryTicket.Sections(3).Controls("lblseqnum".Caption = "0"
Else
drInventoryTicket.Sections(3).Controls("lblseqnum".Caption = db.Project_rs("seqnum"
End If
' PartNumber = db.Project_rs("part_number"
drInventoryTicket.Sections(3).Controls("lblum".Caption = db.Project_rs("uom"
drInventoryTicket.Sections(3).Controls("lbldescr1".Caption = db.Project_rs("descr1"
drInventoryTicket.Sections(3).Controls("lbldescr2".Caption = db.Project_rs("descr2"
drInventoryTicket.Sections(3).Controls("lblloc".Caption = db.Project_rs("loc"
'For count = 1 To db.Project_rs("qty_lbl"
For i = 1 To 3
If i = 1 Then
drInventoryTicket.Sections(3).Controls("lblcopy".Caption = "Accounting Copy"
'drInventoryTicket.Show
'drInventoryTicket.Orientation = rptOrientLandscape
drInventoryTicket.PrintReport False, rptRangeFromTo, 1, 1
ElseIf i = 2 Then
drInventoryTicket.Sections(3).Controls("lblcopy".Caption = "Auditor Copy"
'drInventoryTicket.Show
drInventoryTicket.PrintReport False, rptRangeFromTo, 1, 1
ElseIf i = 3 Then
drInventoryTicket.Sections(3).Controls("lblcopy".Caption = "Material Copy"
drInventoryTicket.Sections(3).Controls("lblmarker".Caption = "XXXX"
'drInventoryTicket.Show
drInventoryTicket.PrintReport False, rptRangeFromTo, 1, 1
End If
Next 'End 3 count loop
'update.Project_My_Conn.Execute ("Update labels_fg_scott set Completed=Yes where part_number ='" & db.Project_rs("part_number" & "'"
'Next 'End qty count loop
'MsgBox db.Project_rs("part_number"
db.Project_rs.MoveNext
Loop Scott
Programmer Analyst
Do Until db.Project_rs.EOF
drInventoryTicket.Sections(3).Controls("lbltype".Caption = "FG"
drInventoryTicket.Sections(3).Controls("lblitnum".Caption = db.Project_rs("part_number"
If CInt(db.Project_rs("seqnum") <= 9 Then
drInventoryTicket.Sections(3).Controls("lblseqnum".Caption = "00000"
ElseIf CInt(db.Project_rs("seqnum") <= 99 Then
drInventoryTicket.Sections(3).Controls("lblseqnum".Caption = "0000"
ElseIf CInt(db.Project_rs("seqnum") <= 999 Then
drInventoryTicket.Sections(3).Controls("lblseqnum".Caption = "000"
ElseIf CInt(db.Project_rs("seqnum") <= 9999 Then
drInventoryTicket.Sections(3).Controls("lblseqnum".Caption = "00"
ElseIf CInt(db.Project_rs("seqnum") <= 99999 Then
drInventoryTicket.Sections(3).Controls("lblseqnum".Caption = "0"
Else
drInventoryTicket.Sections(3).Controls("lblseqnum".Caption = db.Project_rs("seqnum"
End If
' PartNumber = db.Project_rs("part_number"
drInventoryTicket.Sections(3).Controls("lblum".Caption = db.Project_rs("uom"
drInventoryTicket.Sections(3).Controls("lbldescr1".Caption = db.Project_rs("descr1"
drInventoryTicket.Sections(3).Controls("lbldescr2".Caption = db.Project_rs("descr2"
drInventoryTicket.Sections(3).Controls("lblloc".Caption = db.Project_rs("loc"
'For count = 1 To db.Project_rs("qty_lbl"
For i = 1 To 3
If i = 1 Then
drInventoryTicket.Sections(3).Controls("lblcopy".Caption = "Accounting Copy"
'drInventoryTicket.Show
'drInventoryTicket.Orientation = rptOrientLandscape
drInventoryTicket.PrintReport False, rptRangeFromTo, 1, 1
ElseIf i = 2 Then
drInventoryTicket.Sections(3).Controls("lblcopy".Caption = "Auditor Copy"
'drInventoryTicket.Show
drInventoryTicket.PrintReport False, rptRangeFromTo, 1, 1
ElseIf i = 3 Then
drInventoryTicket.Sections(3).Controls("lblcopy".Caption = "Material Copy"
drInventoryTicket.Sections(3).Controls("lblmarker".Caption = "XXXX"
'drInventoryTicket.Show
drInventoryTicket.PrintReport False, rptRangeFromTo, 1, 1
End If
Next 'End 3 count loop
'update.Project_My_Conn.Execute ("Update labels_fg_scott set Completed=Yes where part_number ='" & db.Project_rs("part_number" & "'"
'Next 'End qty count loop
'MsgBox db.Project_rs("part_number"
db.Project_rs.MoveNext
Loop Scott
Programmer Analyst