lolgoodone
New member
- Local time
- Today, 06:43
- Joined
- Sep 15, 2020
- Messages
- 4
Hello ^^
I have spent the better part of a week researching on this topic, and I am not sure whether there is a simple(r) way of doing this - if you can help me or show me my error of ways, I'd be glad
Background info:
I want to have a pop-up form, that behaves and looks like any normal window ever, with Min, Max, and Close ("x") buttons on the top right corner. However, when a user fills in some data via the form and decides to cancel the entry, they might be tempted to just use the "x" instead of the dedicated cancel button. This leaves a half finished entry in my DB. Sure, I could set the forms control box property to "false" or the form border to "none", but that would remove basic form behaviour like resizing, moving or min/maxing.
My question: Is there a way to retain all these features (min/maxing a form, moving and resizing it, closing the form with "x") in this standardised window layout (min, max, "x" on the top right corner) while at the same time making sure that a user just can't press "x" and close the form with a half finished entry?
My intention is to provide a clean, simple, and intuitive way of interacting with the form and its control box (the "intuitive" part being a major headache at times xD)
I had a few ideas in mind already:
To add to point 3, I'll attach a small sample DB as well, where I smashed together some APIs and it works sort of, but not relieably, and it would need quite some work to behave like the standard control box on a form. How to fix those errors would be a seperate question though...
Maybe I'm overlooking some simple solution, but right now I can't see the forrest with all those trees in the way
Thanks in advance ^^
I have spent the better part of a week researching on this topic, and I am not sure whether there is a simple(r) way of doing this - if you can help me or show me my error of ways, I'd be glad

Background info:
I want to have a pop-up form, that behaves and looks like any normal window ever, with Min, Max, and Close ("x") buttons on the top right corner. However, when a user fills in some data via the form and decides to cancel the entry, they might be tempted to just use the "x" instead of the dedicated cancel button. This leaves a half finished entry in my DB. Sure, I could set the forms control box property to "false" or the form border to "none", but that would remove basic form behaviour like resizing, moving or min/maxing.
My question: Is there a way to retain all these features (min/maxing a form, moving and resizing it, closing the form with "x") in this standardised window layout (min, max, "x" on the top right corner) while at the same time making sure that a user just can't press "x" and close the form with a half finished entry?
My intention is to provide a clean, simple, and intuitive way of interacting with the form and its control box (the "intuitive" part being a major headache at times xD)
I had a few ideas in mind already:
- Checking if all necessary fields are filled and only then allowing to close the form, with proper error handling to catch the messages popping up when pressing "x"
- Trapping if a user presses on "x" (prematurely) and running through the cancel routine before closing the record/form
- Creating a custom form title bar and recreating the functions of min, max and "x" manually
- Training all users to use the "cancel" button instead
- Swiching the Control Box property of the form dynamically with VBA
- I have some necessary fields already that must be filled out, while other fields are optional. This might be the easiest to implement, but constant error messages when trying to close the form seem not that user fiendly. (While writing this I figured, I could call the cancel procedure in the error handler, not sure if that will work?)
- There seems to be no way to handle the "x" button being pressed. Other than possibly on the event "On Close", but that didn't work (unless I did smth wrong).
- There is no non-API way to hide the form title bar (is there?), so creating your own title bar with custom buttons looks rather bad and confusing too. Either you have to pick a double-height title bar, or you cannot move/resize the form when disabling the native titlebar because of the borderstyle ("none", "thin").
However, I found quite some solutions with APIs and butchered one together on my own, but there is still some buggy behaviour that I have no idea how to handle/fix. - I'll do that, but this seems to be very prone for errors still.
- Doesn't work, as it can be only set in Design View afaik.
To add to point 3, I'll attach a small sample DB as well, where I smashed together some APIs and it works sort of, but not relieably, and it would need quite some work to behave like the standard control box on a form. How to fix those errors would be a seperate question though...
Maybe I'm overlooking some simple solution, but right now I can't see the forrest with all those trees in the way

Thanks in advance ^^