Reminder before record change if changes were made?

@preks The issue of where to put macros is too long to discuss here. What you are doing will work OK for you.

However, the new macro presented (seen this one before) has a problem. Try this. Make a change in any field in your master record. Now, without saving that master record, click on either of the other subform grids. When you get the message to “Update Record?” select NO & see what happens.

You are right. An error appears saying “Error updating the current record. No values were modified”. But if you think about it, it reverts all changes made before pressing “No”, which means it works normally. Anyway, you think I should prefer the previous macro? And if yes, can you help me adjust the “Undo” macro to the previous? And finally you think we can adjust this or previous macro so they don’t show a message when I press save icon?

@preks You probably don’t realize it but we are right back to my original answer. Either of these two macros you have presented, even with some minor revisions, will have some interface glitches causing user confusion. My original concept was that if any of the three section had any change even started, the other two sections (and listboxes) would become inaccessible and a warning on screen that “Cannot proceed to different record until current changes are saved or cancelled”.

This also is back to the fact of more macros and changes to the form itself. And once again, if later form changes are made who changes the code? This is the problem with macros. They can do some interesting things but are a major concern if you cannot maintain them.

No, sorry Ratslinger. I’m missing something here. I like the fact that if I’m editing the “People” or “Company” subsection and after that click to edit the “Visits” subsection, it will ask me if I really want to update the previous before I continue to the other subsection. And this happens with both macros.

Now, as for your second part, these two macros do not refer to any specific variable of my form. So, how are they affected if I change my form? And if I will decide to change my form, I will ask a question here about an adjustment of the macro code (if I’m not able to solve it by myself).

But you didn’t answer. If I want to keep using this macro, you think we can adjust this or previous macro so they don’t show a message when I press save icon? Or you think I should try adjusting first the Undo feature to the previous macro?

My “concept” would eliminate the annoying message boxes and still provide the same functionality. This “concept” is what would require more macros and that is what was being referred to for code maintenance. But I’m now dropping that whole issue as that does involve a lot of work.

I’ve been looking at your ‘save’ question but until I can prove one or the other I don’t have an answer.

Oh, I misunderstood before then. I’m thankful for your idea but neither you nor me want to insert more macros. (For different reasons each one :stuck_out_tongue: )

What I just want is to do some minor job to just improve this or previous code. But again, I don’t understand what do you mean by prove the one or the other. (Sorry, my English is bad.)

I see this time and again. What seems simple from a users perspective can be much more complex. What my statement was stating was only through testing can I say whether either macro will work or not.

Have tested. Either macro is attached to the Before record action event (right place for it). This event occurs at the table level and at that point it is not known what was last selected on the form. Therefore, it is not known if the ‘save’ was selected or something else which triggered.

Based on what I see, neither macro can be changed to eliminate the message by clicking the save icon.

Your services for this request end here then. I set you free! Thank you for all your help! I’ll leave it as it is for the time being.