I have 2 fields required on my form (date and company). I placed Form Error event in my VB and it looks like this:
All OK, but I get "Nothing..." no matter if Company is empty or Date is empty... This is because "Company" or "Date" aren't really null, I checked with
And I get Nothing... OldValueOfCompanyFieldWhichWasDeleted
SO if I have company named TEST and then delete this name and save form I get "Nothing... TEST". How can I read the field with what it's in it now and not what it was before?
Code:
Private Sub Form_Error(DataErr As Integer, Response As Integer)
Response = acDataErrContinue
Select Case DataErr
Case 3314
If IsNull(Company) Then
MsgBox "Enter company name", vbExclamation, "Incomplete Form"
End If
If IsNull(Date) Then
MsgBox "Enter date", vbExclamation, "Incomplete Form"
Else
MsgBox "Nothing...", vbExclamation, "Incomplete Form"
End If
Case Else
MsgBox "Error number " & DataErr & ". "
End Select
End Sub
All OK, but I get "Nothing..." no matter if Company is empty or Date is empty... This is because "Company" or "Date" aren't really null, I checked with
Code:
...
Else
MsgBox "Nothing..." & Podjetje"
...
And I get Nothing... OldValueOfCompanyFieldWhichWasDeleted
SO if I have company named TEST and then delete this name and save form I get "Nothing... TEST". How can I read the field with what it's in it now and not what it was before?