oxicottin
Learning by pecking away....
- Local time
- Today, 16:20
- Joined
- Jun 26, 2007
- Messages
- 888
Hello, I have a form named "AccidentEntry" and on this form is a subform named "AccidentEntrySubForm". I have a button on the AccidentEntry Form that I need to verify that data is in a text box named "txtRootCause" on my subform before calling a procedure. what is wrong in my code because its going to the procedure then the text field is blank and its suposed to give a msg box and set focuse to the text box on my subform.
Code:
Private Function VerifyEmailData()
If Forms("AccidentEntry")("AccidentEntrySubForm").Form.txtRootCause = "" Then
MsgBox "You Must enter a Root Cause before proceeding! ", vbCritical, "Selection Error"
Forms("AccidentEntry")("AccidentEntrySubForm").Form.txtRootCause.SetFocus
Exit Function
Else
Call EmailData
End If
End Function