Hello Flavelle,
You would properly put the corrected statement in the form's BeforeUpdate
event, and set the event procedure's Cancel argument to True if your
requirements are not met. That will keep the record from being saved. The
following is a sample code that for your reference.
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim strMsg As String
If Not IsNull(Me.C) Then
If Me.B <> Me.C And IsNull(Me.A) Then
Cancel = True
strMsg = strMsg & "You must supply A if B is not C." & vbCrLf
End If
End If
If IsNull(Me.SomeField) Then
Cancel = True
strMsg = strMsg & "SomeField is required." & vbCrLf
End If
If Cancel Then
strMsg = strMsg & vbCrLf & "Correct the entry, or press <Esc> to
undo."
MsgBox strMsg, vbExclamation, "Invalid Data"
End If
End Sub
As for exclamation point before a field and explanation of the error, I
didn't find the exact sample. However, you might add some hidden image,
label and textbox controls and change the Visible property to true in the
event sub.
More related information:
Part 5 of "Keeping Your Information Accurate" in Access 2003 and Access
2002: "Using Validation Rules to Restrict Data"
http://support.microsoft.com/kb/311172/en-us
If you have any further questions or concerns, please feel free to let's
know. Thanks.
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications
<
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx>.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
<
http://msdn.microsoft.com/subscriptions/support/default.aspx>.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.