terpsichore
asked on
query window - maximize then close quits application
Dear experts -
We open a form in our application - it invokes a query and displays the results in datasheet view.
The issue is that users are hitting the MAXIMIZE button in the upper right.
At this point, if the user hits the CLOSE BUTTON ('X') in the upper right (to close the form), this quits the application.
Below is an image of the setting for this form.
Any ideas?
We open a form in our application - it invokes a query and displays the results in datasheet view.
The issue is that users are hitting the MAXIMIZE button in the upper right.
At this point, if the user hits the CLOSE BUTTON ('X') in the upper right (to close the form), this quits the application.
Below is an image of the setting for this form.
Any ideas?
ASKER
I guess this is my problem - how do you 'find' the right close button? How to you 'refind' the controls for that form in datasheet mode?
Is there a simpler solution, where I can alter some of the form's settings?
Is there a simpler solution, where I can alter some of the form's settings?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks so much for these great insights.
ASKER
Actually, I found another solution -
First, the calling form was NOT set to modal - this might have had something to do with it. I changed that to Modal.
For this form: a) I removed the 'can minimize' option; b) I turned BOTH 'popup' AND 'modal' to TRUE; and c) I left 'close box' TRUE as well.
This seems to have fixed the problem - I can now maximize the form (seen in datasheet view), and when I hit the close button, this form closes, NOT the application.
First, the calling form was NOT set to modal - this might have had something to do with it. I changed that to Modal.
For this form: a) I removed the 'can minimize' option; b) I turned BOTH 'popup' AND 'modal' to TRUE; and c) I left 'close box' TRUE as well.
This seems to have fixed the problem - I can now maximize the form (seen in datasheet view), and when I hit the close button, this form closes, NOT the application.
I usually include a Splash form (the form that first loads when my application starts up) in my applications. This form never gets closed until the use closes all other forms and returns to that application. That form does has the standard Control Box and Close Button properties set to NO.
In that forms code module, I:
1. declare a public variable in the form declarations section, which allows me to refer to this variable from throughout the form (and externally as well).
Public AllowClose as Boolean
2. In the Form_Open event of this form, I set that value to False
AllowClose = False
3. In the Form_Unload event, I check to see whether that value is False, and if so, instruct the user to click the "'Quit" button. This will prevent the form, and therefore the application from quiting, because the application cannot quit if there is still a form open.
Open in new window
4. This form also contains a 'Quit' command button with code like:
Open in new window