Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

testing if a form has been edited?

Status
Not open for further replies.

tania20

Programmer
Oct 30, 2006
148
AU
Hi, does anyone know how to check if a form has been edited?

Cheers

tania
 
There is a Dirty property, is that what you mean?
 
thats it!
im guessing then it is something like

If Me.Dirty = True then
...

end if

cheers
 
mmm, its not really working how i expected. On my form unload i want to check if there have been any edits, if there has i want to display a custom save msgbox.if they choose no here then the edits will be discarded.

If Me.Dirty then

If MsgBox(strmsg, vbQuestion + vbYesNo, "Save Record?") = vbYes Then
...code here...
Else
DoCmd.RunCommand acCmdUndo
End if

yet me.dirty is returning false even when I have edited data?
 
HI tania:

Put your code in the 'before update' event of the form. By the time the form unload event runs, the edits have already been saved (which is why the Me.dirty is returning false).

Hope that helps,
T
 
PS: You'll need another 'End If' (no parens) at the end of your code...
T
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top