Xenix
Registered User.
- Local time
- Today, 16:23
- Joined
- Oct 8, 2001
- Messages
- 124
I have a problem, hope someone can help.
I have the following code:
If Forms![stores].RecordCount = 0 Then
MsgBox "There are no Jobs to complete yet", vbOKOnly
Else
If Me!Printme = "PRINTED" Then
Me!Box38.BackColor = 255
' Otherwise, display as a green box.
Else
Me!Box38.BackColor = 65280
End If
Forms!stores!TrayDetailsSub2.SetFocus
End If
Maybe you can see the problem here. When the form opens it
sets the colour of printed box to green or red the problem is if I open the form when there are no work orders the query has no records so the Printme field is not present creating an error, is there a simple way like the first IF statement that will do this?
Thank you in advance
Mike
I have the following code:
If Forms![stores].RecordCount = 0 Then
MsgBox "There are no Jobs to complete yet", vbOKOnly
Else
If Me!Printme = "PRINTED" Then
Me!Box38.BackColor = 255
' Otherwise, display as a green box.
Else
Me!Box38.BackColor = 65280
End If
Forms!stores!TrayDetailsSub2.SetFocus
End If
Maybe you can see the problem here. When the form opens it
sets the colour of printed box to green or red the problem is if I open the form when there are no work orders the query has no records so the Printme field is not present creating an error, is there a simple way like the first IF statement that will do this?
Thank you in advance
Mike