[AccessD] Suppress System Dialog when closing DataSheet Form

JWColby jwcolby at colbyconsulting.com
Tue Apr 10 10:36:52 CDT 2007


Yes, but you will have to disable the close button in the upper left of the
form (the X), then build a close button that runs that code.

John W. Colby
Colby Consulting
www.ColbyConsulting.com

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Mark A Matte
Sent: Tuesday, April 10, 2007 11:31 AM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Suppress System Dialog when closing DataSheet Form

Borge,

Could you use:
   DoCmd.Close acForm, "form1", acSaveNo

to close the form?

Thanks,

Mark A. Matte



>From: <pcs at azizaz.com>
>Reply-To: Access Developers discussion and problem 
>solving<accessd at databaseadvisors.com>
>To: Access Developers discussion and problemsolving 
><accessd at databaseadvisors.com>
>CC: pcs at azizaz.com
>Subject: [AccessD]  Suppress System Dialog when closing DataSheet Form
>Date: Tue, 10 Apr 2007 14:50:51 +1000 (EST)
>
>Hi,
>
>I need help with the following:
>
>I am opening a form called frmDisplay in design mode from code that has 
>opened an ado recordset
>
>frmDisplay has 100 text controls named
>TextControl1,
>TextControl2,
>..
>TextControl100
>
>that's all... no code behind form
>
>After opening the Form I set the name of the textcontrols to the name 
>of the fields in the ado recordset; next I set the recordsource of the 
>now named textcontrols to the fields in the ado recordset; then I set 
>the recordset of frmDisplay to the ado recordset; and I open the Form 
>is Datasheet mode....
>
>So far so good....I can see the ado recordset as a 'table', resizing 
>columns etc. .... any unused textcontrols are still named 
>TextControl(n) .... all is good!
>
>My problem comes when I am closing frmDisplay using the datasheet's 
>close control.
>
>I want to suppress the Access System prompt:
>
>"The Form has been changed etc. do you want to save the changes?" 
>Yes(default)  - No - Cancel
>
>The User should just be able to close the Form .....
>
>I've tried to cancel the closing of the Form on the UnLoad event - in 
>order to gain programmatic control of the close process, but the system 
>prompt has already kicked in by then....  If I set warnings to False, I 
>get rid of the system prompt, but since Yes is the default - the Form 
>is closed with all design changes saved!! not good!!
>
>Any suggestion??
>
>Regards
>borge
>
>
>The User sh
>--
>AccessD mailing list
>AccessD at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/accessd
>Website: http://www.databaseadvisors.com

_________________________________________________________________
MSN is giving away a trip to Vegas to see Elton John.  Enter to win today. 
http://msnconcertcontest.com?icid-nceltontagline





More information about the AccessD mailing list