Senin, 06 Juni 2016

Re: [MS_AccessPros] Changes made to form


Thank you John. Running that code in the Cancel button Click event produces this error: Run-time error '2455': You entered an expression that has an invalid reference to the property Dirty.

Wonder if Me in Me.Dirty is pointing to the Cancel button rather than the form?


On 6/6/2016 4:51 PM, John Viescas [MS_Access_Professionals] wrote:


Check the Dirty property of the form in the Click event of your Cancel button.

If Me.Dirty = True Then
If vbNo = MsgBox("You have unsaved changes. Are you sure you want to cancel?", _
vbQuestion + vbYesNo + vbDefaultButton2) Then Exit Sub
End If
End If

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
(Paris, France)

On Jun 6, 2016, at 10:37 PM, Steve thaw5 [MS_Access_Professionals] <> wrote:

I have a form which presents an existing record to the user. The form
has a Save And Close command button as well as a Cancel button.

The user can edit any of the ten or so text fields and then click Save
And Close to save the revised record to the database. But sometimes the
user inadvertently clicks Cancel and desired changes are lost.

If changes were made to the form, then when the user clicks Cancel I'd
like to remind him that changes were made and ask for confirmation that
he really wants to close the form without saving the changes. How can I
know if any of the text fields were changed?

Thanks. Steve

Posted by: Steve thaw5 <>


Yahoo Groups Links


Posted by: Steve5 <>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.



Tidak ada komentar:

Posting Komentar