I figured out that my "If Me.Dirty then Me.Undo" idea was sound, I just had it in the wrong place. The controls are disabled, as per HartCraft's suggestion, so you have to click the Close button to close the form. But in the Close Click handler, I use the code DoCmd.Close acForm, Me.Name to close the form, and had Me.Undo in the form's Close handler. By the time the form's Close handler fires, the record is already saved and the form is no longer dirty. By moving the If Me.Dirty code to the close button's click handler it solved the problem.
Mike