A
Anthony
I have this bit of VB code on the "Click" event button that closes a form.
If Me.Dirty = True Then
If MsgBox("Do you wish to save changes?", vbYesNo, "Notice") = vbNo
Then
Me.Undo
DoCmd.Close acForm, "frm_Comments"
Else
DoCmd.Close acForm, "frm_Comments"
End If
Else
DoCmd.Close acForm, "frm_Comments"
End If
I thought I programmed this to ONLY pop up the message box if a change was
made on the form. However, the message box pops up regardless of whether I
made a change (Dirty) or not.
Here is some background on the form. This form with this Click event is a
pop up form from another form. This form has an "OnOpen" event that uses VB
to populate the form, so it is not populated from a query or table. I use a
Me.cbo_Issue04.RowSource = "SELECT " . . . code to populate the form upon
open.
Any help would be appreciated.
If Me.Dirty = True Then
If MsgBox("Do you wish to save changes?", vbYesNo, "Notice") = vbNo
Then
Me.Undo
DoCmd.Close acForm, "frm_Comments"
Else
DoCmd.Close acForm, "frm_Comments"
End If
Else
DoCmd.Close acForm, "frm_Comments"
End If
I thought I programmed this to ONLY pop up the message box if a change was
made on the form. However, the message box pops up regardless of whether I
made a change (Dirty) or not.
Here is some background on the form. This form with this Click event is a
pop up form from another form. This form has an "OnOpen" event that uses VB
to populate the form, so it is not populated from a query or table. I use a
Me.cbo_Issue04.RowSource = "SELECT " . . . code to populate the form upon
open.
Any help would be appreciated.