pat_nospam
Registered User.
- Local time
- Today, 19:36
- Joined
- Oct 14, 2003
- Messages
- 151
Okay - I know there must be a programatic way to do this without the lengthy checks. Here is the code I am working with in order to show a picture.
How can I check if the 14 checkboxes are populated, without manually checking each one. Then, after checking them, if one is populated, how do I tell my Else statement which one to grab (i.e. Me!Picture.Picture = GetPathPart & Me!Court# & ".jpg"
Thanks for the assist
Code:
Private Sub Form_Open(Cancel As Integer)
On Error GoTo Err_Form_Open
If IsNull(Me!Court1) Or Me!Court1 = "" Or IsNull(Me!Court2) Or Me!Court2 = "" Or IsNull(Me!Court3) Or Me!Court3 = "" Or IsNull(Me!Court4) Or Me!Court4 = "" Or IsNull(Me!Court5) Or Me!Court5 = "" Or IsNull(Me!Court6) Or Me!Court6 = "" Or IsNull(Me!Court7) Or Me!Court7 = "" Or IsNull(Me!Court8) Or Me!Court8 = "" Or IsNull(Me!Court9) Or Me!Court9 = "" Or IsNull(Me!Court10) Or Me!Court10 = "" Or IsNull(Me!Court11) Or Me!Court11 = "" Or IsNull(Me!Court12) Or Me!Court12 = "" Or IsNull(Me!Court13) Or Me!Court13 = "" Or IsNull(Me!Court14) Or Me!Court14 = "" Then
Me!Picture.Picture = GetPathPart & "1.jpg"
Else
Me!Picture.Picture = GetPathPart & Me!Court & ".jpg"
End If
Exit_Form_Open:
Exit Sub
Err_Form_Open:
MsgBox Err.Description
Resume Exit_Form_Open
End Sub
How can I check if the 14 checkboxes are populated, without manually checking each one. Then, after checking them, if one is populated, how do I tell my Else statement which one to grab (i.e. Me!Picture.Picture = GetPathPart & Me!Court# & ".jpg"
Thanks for the assist