Form_Error event

A

an

When I run the next code, after Cancel = True, appear Menu
with "You can't save this record at this time"

How is possible omit it, please.

Dim strField As String
Dim vFields As Variant
Dim i As Integer
Dim strMsg As String
vFields = Split("Field1,Field2", ",")
For i = 0 To UBound(vFields, 1)
If IsNull(Me(vFields(i))) = True Then
strField = vFields(i)
Exit For
End If
Next i
If strField <> "" Then
If MsgBox("Message: " & "'" & strField & "'",
vbOKOnly + vbInformation + _
vbDefaultButton2, "EMPTY") = vbOK Then
Me(strField).SetFocus
Cancel = True

' Form_Error Event
' (?)
Else
Me.Undo
End If
End If

Thanks in advance.
an
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top