Hi guys, i have a little problem regarding the code that i wish to use on my form:
[FONT="]
[/FONT]
[FONT="]Private Sub Form_BeforeUpdate(Cancel As Integer)[/FONT]
[FONT="]If Me.Status = "Installed" Then[/FONT]
[FONT="] If IsNull(Me.[Install Date]) Then[/FONT]
[FONT="] MsgBox "If status is Installed, you have to enter Date value", vbOKOnly[/FONT]
[FONT="] Cancel = True[/FONT]
[FONT="] Me.[Install Date].SetFocus[/FONT]
[FONT="] End If[/FONT]
[FONT="]End If[/FONT]
[FONT="]End Sub[/FONT]
If I enter the data, code works well. Also if I don't enter the data upon clicking "save & exit" button on my form, message box appears and that's also fine, but! After message box appears and clicking OK onto it, also an error 2169 appears (You can't save the record at this time...) which I wouldn't like to be seen.
Can you make any suggestions what to do?
Thanks in advance
[FONT="]
[/FONT]
[FONT="]Private Sub Form_BeforeUpdate(Cancel As Integer)[/FONT]
[FONT="]If Me.Status = "Installed" Then[/FONT]
[FONT="] If IsNull(Me.[Install Date]) Then[/FONT]
[FONT="] MsgBox "If status is Installed, you have to enter Date value", vbOKOnly[/FONT]
[FONT="] Cancel = True[/FONT]
[FONT="] Me.[Install Date].SetFocus[/FONT]
[FONT="] End If[/FONT]
[FONT="]End If[/FONT]
[FONT="]End Sub[/FONT]
If I enter the data, code works well. Also if I don't enter the data upon clicking "save & exit" button on my form, message box appears and that's also fine, but! After message box appears and clicking OK onto it, also an error 2169 appears (You can't save the record at this time...) which I wouldn't like to be seen.
Can you make any suggestions what to do?
Thanks in advance