The code from the link below prompts a user to save the current record before changing records if the form is dirty. I've put this code in my form, but it produces an error anytime I select No to not save the record.
For instance, in a new record on the form, type something in any field and hit the new button. Answering no to the save prompt produces run-time error 2105 "You can't go to the specified record," which then highlights the DoCmd.GoToRecord , , acNewRec from the new button.
http://www.databasedev.co.uk/prompt_to_save.html
It's a simple form and I've uploaded it to this post. Can someone please assist?
For instance, in a new record on the form, type something in any field and hit the new button. Answering no to the save prompt produces run-time error 2105 "You can't go to the specified record," which then highlights the DoCmd.GoToRecord , , acNewRec from the new button.
http://www.databasedev.co.uk/prompt_to_save.html
It's a simple form and I've uploaded it to this post. Can someone please assist?