G
Guest
Hi All...I have three fields that I would like end users to enter before
closing the form. I have following code
If IsNull(Me.tblClient_ClientName) Then
MsgBox "Missing Client Name", vbCritical, msgTitle
Me.tblClient_ClientName.SetFocus
ElseIf IsNull(Me.tblClient_CID) Then
MsgBox "Missing Client CID", vbCritical, msgTitle
Me.tblClient_CID.SetFocus
ElseIf IsNull(Me.tblClient_Product) Then
MsgBox "Missing Client Product", vbCritical, msgTitle
Me.tblClient_Product.SetFocus
end if
Now when there is not value in any of the three fields, the system does give
an error and sets the focus on Client Name. Once I provide the client name
then it stops at Client CID. Now, if I erase the client name it still accepts
the null value and doesn't give error message. I know I can fix this by
setting the field property to required in table; however, I don't want to do
that. What is the easy way I can always loop through to make sure they have
not erased the data after entering it once they get the error message.
Thanks.
closing the form. I have following code
If IsNull(Me.tblClient_ClientName) Then
MsgBox "Missing Client Name", vbCritical, msgTitle
Me.tblClient_ClientName.SetFocus
ElseIf IsNull(Me.tblClient_CID) Then
MsgBox "Missing Client CID", vbCritical, msgTitle
Me.tblClient_CID.SetFocus
ElseIf IsNull(Me.tblClient_Product) Then
MsgBox "Missing Client Product", vbCritical, msgTitle
Me.tblClient_Product.SetFocus
end if
Now when there is not value in any of the three fields, the system does give
an error and sets the focus on Client Name. Once I provide the client name
then it stops at Client CID. Now, if I erase the client name it still accepts
the null value and doesn't give error message. I know I can fix this by
setting the field property to required in table; however, I don't want to do
that. What is the easy way I can always loop through to make sure they have
not erased the data after entering it once they get the error message.
Thanks.