With the two responses in posts 10 & 11 and also several direct messages from others, its time for me to explain fully how this works for those who aren't already aware. If you don't want to know the answer, please 'look away' now!
Before I go any further, congratulations to
@tvanstiphout,
@arnelgp,
@Lampje and
@KitaYama - you worked out almost everything between you
The database has two hidden objects - an autoexec macro and a form.
It was also locked down with the navigation pane hidden and shift bypass disabled.
I could have done parts of this puzzle without a macro or without a form but I needed both for different features.
As stated repeatedly, there is no VBA code used in the app.
The autoexec macro is used to first open the form (hidden), then close it and finally quit the app.
Macro actions are XML and NOT VBA code (though they can be used to run VBA code or messages)
The hidden form is shown in
@Lampje's screenshot in post #11 although he has modified the database slightly with additional objects.
The form runs three different styles of message in turn from the load, current & close events:. The message contents are entered directly into the property sheet. I could have used functions instead but that would require VBA code!
As mentioned there are at least 6 ways of running messages:
- Using VBA code
- from the Immediate window
- as a function run from a form / report event in the property sheet
- directly written into an event in the object property sheet
- from a saved macro
- from an embedded macro
The first 3 methods use the VBA MsgBox function, the last 3 use the Access Expression Service
I created messages from the property sheet as I needed to use the MsgBox function from the Access expression service.
This supports the Line1@Line2@Line3 notation. That is used to create the bold first line (message 2).
Alternatively, it creates the new style (message 3) if the help file and context arguments are included.
See my article:
https://www.isladogs.co.uk/eval-new-style-msgbox/index.html
I could have created the first 2 messages direct from the macro but not the third as macros don't support the help file & context arguments
The VBA MsgBox function does not support this notation unless it is wrapped in the Eval function.
However, doing that causes the Access Expression Service to be used instead.
Whenever I try out unknown databases, I always run them from a non-trusted location to prevent code running.
However, even then, actions designated as 'safe' will still run from an autoexec macro.
So in this case, the first two messages still run but the third is blocked as it is immediately followed by an 'unsafe' action (marked with a warning sign in the macro)
The only thing nobody has yet explained is why the menu bar gets restricted only after you click OK on the second message.
Its not difficult to explain but I'll leave that as 'unsolved' for now.
Attached is a fully unlocked version of the puzzle app
NOTE: Now the puzzle is out of the way, I intend to write a short article about running messages using the Access Expression Service.
EDIT: 2023-03-16:
Article now published and includes the solution to this puzzle
This article explains different ways that the Access expression service can be used to create messages. It also explains how the behaviour and appearance of these compare to messages created using the VBA MsgBox function.
www.isladogs.co.uk