I am new at writing code coding and I hope someone can tell what I am doing wrong.
I am trying to write code to require 3 fields be entered before the form will close, but it will not step through the 3 steps and when you click the ok button it will close the form.
Thanks
If IsNull(Me!customer_name) Then
MsgBox ("Enter the customer name or a contact person!")
Me.common_litel_ckt.SetFocus
End Sub
ElseIf IsNull(Me!customer_acct_id) Then
MsgBox ("Enter a Customer Account.")
Me.customer_acct_id.SetFocus
Exit Sub
ElseIf IsNull(Me!cust_phone) Then
MsgBox ("Enter a Phone Number!.")
Me.project_name.SetFocus
Exit Sub
End If
Forms!frmMain.Requery
Forms!frmMain!subDSView.Form.Requery
End Sub
I am trying to write code to require 3 fields be entered before the form will close, but it will not step through the 3 steps and when you click the ok button it will close the form.
Thanks
If IsNull(Me!customer_name) Then
MsgBox ("Enter the customer name or a contact person!")
Me.common_litel_ckt.SetFocus
End Sub
ElseIf IsNull(Me!customer_acct_id) Then
MsgBox ("Enter a Customer Account.")
Me.customer_acct_id.SetFocus
Exit Sub
ElseIf IsNull(Me!cust_phone) Then
MsgBox ("Enter a Phone Number!.")
Me.project_name.SetFocus
Exit Sub
End If
Forms!frmMain.Requery
Forms!frmMain!subDSView.Form.Requery
End Sub