T
tina
Hi
I have a form where user will select a variable number of safety hazards by
picture for each record the picture will have a path name which needs to go
into a textbox on form. there can be upto 10 pictures per record choosen from
20 or more pictures
i have started to write an else if statement but it is very long winded as
can see below which runs on click of button the check box picures text are
all in subform to mainform
I thought about using array or tab control but not sure how to do this
Thank you
Tina
Private Sub Command24_Click()
If Me.Check3 = True Then
If IsNull(Forms!nexusb1.SafetyHazard1) Then
Forms!nexusb1.SafetyHazard1 = Me.Text25
ElseIf IsNull(Forms!nexusb1.SafetyHazard2) Then
Forms!nexusb1.SafetyHazard2 = Me.Text25
ElseIf IsNull(Forms!nexusb1.SafetyHazard3) Then
Forms!nexusb1.SafetyHazard3 = Me.Text25
ElseIf IsNull(Forms!nexusb1.SafetyHazard4) Then
Forms!nexusb1.SafetyHazard4 = Me.Text25
End If
End If
If Me.Check12 = True Then
If IsNull(Forms!nexusb1.SafetyHazard1) Then
Forms!nexusb1.SafetyHazard1 = Me.Text34
ElseIf IsNull(Forms!nexusb1.SafetyHazard2) Then
Forms!nexusb1.SafetyHazard2 = Me.Text34
ElseIf IsNull(Forms!nexusb1.SafetyHazard3) Then
Forms!nexusb1.SafetyHazard3 = Me.Text34
ElseIf IsNull(Forms!nexusb1.SafetyHazard4) Then
Forms!nexusb1.SafetyHazard4 = Me.Text34
End If
End If
If Me.Check7 = True Then
If IsNull(Forms!nexusb1.SafetyHazard1) Then
Forms!nexusb1.SafetyHazard1 = Me.Text29
ElseIf IsNull(Forms!nexusb1.SafetyHazard2) Then
Forms!nexusb1.SafetyHazard2 = Me.Text29
ElseIf IsNull(Forms!nexusb1.SafetyHazard3) Then
Forms!nexusb1.SafetyHazard3 = Me.Text29
ElseIf IsNull(Forms!nexusb1.SafetyHazard4) Then
Forms!nexusb1.SafetyHazard4 = Me.Text29
End If
End If
I have a form where user will select a variable number of safety hazards by
picture for each record the picture will have a path name which needs to go
into a textbox on form. there can be upto 10 pictures per record choosen from
20 or more pictures
i have started to write an else if statement but it is very long winded as
can see below which runs on click of button the check box picures text are
all in subform to mainform
I thought about using array or tab control but not sure how to do this
Thank you
Tina
Private Sub Command24_Click()
If Me.Check3 = True Then
If IsNull(Forms!nexusb1.SafetyHazard1) Then
Forms!nexusb1.SafetyHazard1 = Me.Text25
ElseIf IsNull(Forms!nexusb1.SafetyHazard2) Then
Forms!nexusb1.SafetyHazard2 = Me.Text25
ElseIf IsNull(Forms!nexusb1.SafetyHazard3) Then
Forms!nexusb1.SafetyHazard3 = Me.Text25
ElseIf IsNull(Forms!nexusb1.SafetyHazard4) Then
Forms!nexusb1.SafetyHazard4 = Me.Text25
End If
End If
If Me.Check12 = True Then
If IsNull(Forms!nexusb1.SafetyHazard1) Then
Forms!nexusb1.SafetyHazard1 = Me.Text34
ElseIf IsNull(Forms!nexusb1.SafetyHazard2) Then
Forms!nexusb1.SafetyHazard2 = Me.Text34
ElseIf IsNull(Forms!nexusb1.SafetyHazard3) Then
Forms!nexusb1.SafetyHazard3 = Me.Text34
ElseIf IsNull(Forms!nexusb1.SafetyHazard4) Then
Forms!nexusb1.SafetyHazard4 = Me.Text34
End If
End If
If Me.Check7 = True Then
If IsNull(Forms!nexusb1.SafetyHazard1) Then
Forms!nexusb1.SafetyHazard1 = Me.Text29
ElseIf IsNull(Forms!nexusb1.SafetyHazard2) Then
Forms!nexusb1.SafetyHazard2 = Me.Text29
ElseIf IsNull(Forms!nexusb1.SafetyHazard3) Then
Forms!nexusb1.SafetyHazard3 = Me.Text29
ElseIf IsNull(Forms!nexusb1.SafetyHazard4) Then
Forms!nexusb1.SafetyHazard4 = Me.Text29
End If
End If