To all
Good afternoon.
I have introduced the following check to effectively make the on-call Physician field mandatory:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Speciality = "A&E" And Len(Me.AdmittingPhysician & vbNullString) = 0 Then
Cancel = True
MsgBox "You need to fill in a name of the on-call Physician if you have selected 'A&E'", vbExclamation, "Entry Error"
End If
End Sub
However, I need this condition to be relevant on other fields - DOB and Who Performance. See below.
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Neur
ncology = "Yes" And (Len(Me.WHOPerformanceStatus & vbNullString) Or Len(Me.DOB & vbNullString)) = 0 Then
Cancel = True
MsgBox "You need to fill in either DOB and/or WHO Performance Status if you have selected Oncology 'Yes'", vbExclamation, "Entry Error"
End If
End Sub
Can the code be merged to one script or is it possible to have two BeforeUpdate events on a Form?
Any solutions or direction would be grateful received.
Thanks.
pedroghuk

Good afternoon.
I have introduced the following check to effectively make the on-call Physician field mandatory:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Speciality = "A&E" And Len(Me.AdmittingPhysician & vbNullString) = 0 Then
Cancel = True
MsgBox "You need to fill in a name of the on-call Physician if you have selected 'A&E'", vbExclamation, "Entry Error"
End If
End Sub
However, I need this condition to be relevant on other fields - DOB and Who Performance. See below.
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Neur

Cancel = True
MsgBox "You need to fill in either DOB and/or WHO Performance Status if you have selected Oncology 'Yes'", vbExclamation, "Entry Error"
End If
End Sub
Can the code be merged to one script or is it possible to have two BeforeUpdate events on a Form?
Any solutions or direction would be grateful received.
Thanks.
pedroghuk
