The answer was to use a form subform, not a query subform. See MajP's answer here: https://www.access-programmers.co.uk/forums/threads/how-do-i-save-the-layout-of-a-subform-after-modifying-it-on-the-main-forms-on-open-event.334086/#post-1963627
You should not have to save or get this message. I do this all the time without any prompt. However it looks to me that your subform source object is a query object and not a form in datasheet. Make sure to use a datasheet form and your problem should go away. Also call the code in the on load event and not the on open event.