I have a combobox with options to send confirmations to the company after a particular operation is completed.
If the user chooses "Email" confirmation I'd like the subform to check if an email has been provided on the parent form.
If one has not been provided I'd like to move the focus to the email textbox on the parent form.
I'm currently getting a RT error 2110 stating that it can't move the focus to 'HospEmail'
Any help would be appreciated.
CODE
Private Sub cboSpellCheck_BeforeUpdate(Cancel As Integer)
Select Case Me.cboSpellCheck
Case 1 ' Email
If Nz(Me.Parent!HospEmail, "") = "" Then
MsgBox "You cannot set Spell Check to Email if an Email is not provided." & _
vbCrLf & vbCrLf & "Please enter an email address first.", vbInformation, "NO EMAIL PROVIDED"
Cancel = -1
Forms!frmHospitalsInfo!HospEmail.SetFocus
End If
Case 2 ' Fax
'
Case 3 ' None
'
End Select
End Sub
Select Case Me.cboSpellCheck
Case 1 ' Email
If Nz(Me.Parent!HospEmail, "") = "" Then
MsgBox "You cannot set Spell Check to Email if an Email is not provided." & _
vbCrLf & vbCrLf & "Please enter an email address first.", vbInformation, "NO EMAIL PROVIDED"
Cancel = -1
Forms!frmHospitalsInfo!HospEmail.SetFocus
End If
Case 2 ' Fax
'
Case 3 ' None
'
End Select
End Sub