J
jbiggs via AccessMonster.com
The expression Before Update you entered as the event property setting
produced the following error: The Save action was canceled.
*The expression may not result in the name of a macro, the name of a user-
defined function, or [Event Procedure].
*There may have been an error evaluating the function, event or macro.
Here is the code:
Private Sub lead_status_BeforeUpdate(Cancel As Integer)
Dim lastupdate As Date
lastupdate = Format(Nz(DMax("[note date]", "Notes", "[ID] =" & Me.ID),
"01/01/1900"), "mm/dd/yyyy")
'MsgBox "lastupdate =" & lastupdate & "ID =" & Me.ID
If lastupdate < date Then
MsgBox "You must update client's notes before changing status",
vbOKOnly, "Client notes not updated!"
Me.lead_status.Undo
Cancel = True
Else
DoCmd.Save
End If
End Sub
produced the following error: The Save action was canceled.
*The expression may not result in the name of a macro, the name of a user-
defined function, or [Event Procedure].
*There may have been an error evaluating the function, event or macro.
Here is the code:
Private Sub lead_status_BeforeUpdate(Cancel As Integer)
Dim lastupdate As Date
lastupdate = Format(Nz(DMax("[note date]", "Notes", "[ID] =" & Me.ID),
"01/01/1900"), "mm/dd/yyyy")
'MsgBox "lastupdate =" & lastupdate & "ID =" & Me.ID
If lastupdate < date Then
MsgBox "You must update client's notes before changing status",
vbOKOnly, "Client notes not updated!"
Me.lead_status.Undo
Cancel = True
Else
DoCmd.Save
End If
End Sub