I am using the following code on two forms in the same database. works great on one and halts the other with -msg "variable not defined"
I have a "pick date" calender on this form which uses several modules and code in events
Form_Load
Form_Unload
Any obvious ideas as to what's going on?
-dimmech
Code:
[highlight]Private Sub Form_BeforeUpdate(Cancel As Integer)[/highlight]
On Error GoTo Err_Form_BeforeUpdate
DMsg = "You are about to update data!" & [highlight #DEDEDE]vbCtrlf[/highlight]
Msg = Msg & "Do you wish to update the record?"
Title = "Save Record?"
Style = vbYesNo + vbCritical + vbDefaultButton2
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then
MsgBox "Record Saved!", vbOKOnly
Else
If Me.Dirty Then
DoCmd.RunCommand acCmdUndo
End If
End If
Exit_Form_BeforeUpdate:
Exit Sub
Err_Form_BeforeUpdate:
MsgBox Err.Description
Resume Exit_Form_BeforeUpdate
End Sub
I have a "pick date" calender on this form which uses several modules and code in events
Form_Load
Form_Unload
Any obvious ideas as to what's going on?
-dimmech