bruceblack
Registered User.
- Local time
- Today, 21:04
- Joined
- Jun 30, 2017
- Messages
- 119
Hi everyone! I have a question i hope you call all help me out with. I'm completely stuck here :S.
The code below is working, but it skips the first record it goes through it seems.
What im trying to do: it needs to loop through "shipments" table, find if the answer is "Yes" and if so, put an icon on my report.
Problem: It does put the icon on my report when the answer is "Yes" throughout my table somewhere, but not if the first record has the answer "Yes" answer.
What is going on here Thanks in advance! Would help a great deal!
The code below is working, but it skips the first record it goes through it seems.
What im trying to do: it needs to loop through "shipments" table, find if the answer is "Yes" and if so, put an icon on my report.
Problem: It does put the icon on my report when the answer is "Yes" throughout my table somewhere, but not if the first record has the answer "Yes" answer.
What is going on here Thanks in advance! Would help a great deal!
Code:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("SELECT * FROM shipments Where [checklistID] = " & Me![checklistID])
Do Until rs.EOF
If rs!dg = "Yes" Then 'this is my form field
Me("attentiondg").Visible = True
Else
Me("attentiondg").Visible = False
End If
If rs!t1 = "Yes" Then 'this is my form field
Me("attentiont1").Visible = True
Else
Me("attentiont1").Visible = False
End If
rs.MoveNext
Loop
rs.Close 'Close the recordset
Set rs = Nothing 'Clean up
End Sub