By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,780 Members | 1,520 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,780 IT Pros & Developers. It's quick & easy.

how to get rid of the prompt for saving changes

P: n/a
ARC
Hello all,

I didn't use to have this problem in Access 97, but in 2007 (and maybe other
versions of access after 97), if you have a form that has a subform, and you
click the close button, you always get the following dialog:

"Save changes to the following objects?"

I tried putting a saverecord command prior to the close, but that had no
affect. I have found a work around, but maybe I am making this too
difficult?

What I do is to put code on the close button that reassigns the sourceobject
of any subforms to a blank form, such as:

me!subParts.sourceobject = "subBlank" 'subBlank is my form that is
totally blank, free of code and controls, etc.
docmd.close acForm, "fParts", acSaveNo

The above 2 lines is the only way I've found to prevent the Access prompt
from popping up.

Is there an easier way? It's kind of a pain to do this, and if the user
clicks the 'X' to close, they'll still get the save prompt.

Many Thanks,
Jul 23 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Mon, 23 Jul 2007 16:56:10 GMT, "ARC" <an**@andyc.comwrote:
>Hello all,

I didn't use to have this problem in Access 97, but in 2007 (and maybe other
versions of access after 97), if you have a form that has a subform, and you
click the close button, you always get the following dialog:

"Save changes to the following objects?"
The only time you'd get this prompt would be if you make Design changes to your objects. I'm not sure why setting your
..SourceObject to a blank object would stop this message, however. Review your code and make sure you're not making
design changes in code.
>
I tried putting a saverecord command prior to the close, but that had no
affect. I have found a work around, but maybe I am making this too
difficult?

What I do is to put code on the close button that reassigns the sourceobject
of any subforms to a blank form, such as:

me!subParts.sourceobject = "subBlank" 'subBlank is my form that is
totally blank, free of code and controls, etc.
docmd.close acForm, "fParts", acSaveNo

The above 2 lines is the only way I've found to prevent the Access prompt
from popping up.

Is there an easier way? It's kind of a pain to do this, and if the user
clicks the 'X' to close, they'll still get the save prompt.

Many Thanks,
Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
Jul 24 '07 #2

P: n/a
ARC
Hmmm...

The only thing I could find is that I'm running a function when a form is
opened that resets the date format for any date fields (this is to
accomodate the differing date formats especially in the UK and Australia).
Also, this same function will hide fields where they have selected not to
use a particular feature, etc.

I got the idea to use a blank subform on close, because it would prompt to
save the form object, and all subform objects on close. So if I set the
sourceobject of the subforms to a blank form, then close with a AcSaveNo
command, I don't get the popup.

Again, I never had this problem in Access 97.

Speaking of date fields... I wonder if it's still necessary in Acc2007 for
me to have the code for date fields to cover different country settings? For
example, if the user was in Australia, they would set their date setting in
a setup screen to : "dd-mmm-yyyy", so in code, I would set the .format of a
control to "dd-mmm-yyyy", etc., on the forms's onOpen event.

Many thanks for the reply, Scott.

Andy
"Scott McDaniel" <scott@NoSpam_Infotrakker.comwrote in message
news:hq********************************@4ax.com...
On Mon, 23 Jul 2007 16:56:10 GMT, "ARC" <an**@andyc.comwrote:
>>Hello all,

I didn't use to have this problem in Access 97, but in 2007 (and maybe
other
versions of access after 97), if you have a form that has a subform, and
you
click the close button, you always get the following dialog:

"Save changes to the following objects?"

The only time you'd get this prompt would be if you make Design changes to
your objects. I'm not sure why setting your
.SourceObject to a blank object would stop this message, however. Review
your code and make sure you're not making
design changes in code.
>>
I tried putting a saverecord command prior to the close, but that had no
affect. I have found a work around, but maybe I am making this too
difficult?

What I do is to put code on the close button that reassigns the
sourceobject
of any subforms to a blank form, such as:

me!subParts.sourceobject = "subBlank" 'subBlank is my form that is
totally blank, free of code and controls, etc.
docmd.close acForm, "fParts", acSaveNo

The above 2 lines is the only way I've found to prevent the Access prompt
from popping up.

Is there an easier way? It's kind of a pain to do this, and if the user
clicks the 'X' to close, they'll still get the save prompt.

Many Thanks,

Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com

Jul 24 '07 #3

P: n/a
ARC
I just tested and commented out my code for the dates, etc., and it still
comes up. On the subform, I'm setting the .columnhidden property of certain
fields based on setup options as well, so that is probably triggering the
save prompt. I guess I'm stuck, as I have to have the setup options work
when a form opens.
"ARC" <an**@andyc.comwrote in message
news:PI*****************@newssvr13.news.prodigy.ne t...
Hmmm...

The only thing I could find is that I'm running a function when a form is
opened that resets the date format for any date fields (this is to
accomodate the differing date formats especially in the UK and Australia).
Also, this same function will hide fields where they have selected not to
use a particular feature, etc.

I got the idea to use a blank subform on close, because it would prompt to
save the form object, and all subform objects on close. So if I set the
sourceobject of the subforms to a blank form, then close with a AcSaveNo
command, I don't get the popup.

Again, I never had this problem in Access 97.

Speaking of date fields... I wonder if it's still necessary in Acc2007 for
me to have the code for date fields to cover different country settings?
For example, if the user was in Australia, they would set their date
setting in a setup screen to : "dd-mmm-yyyy", so in code, I would set the
.format of a control to "dd-mmm-yyyy", etc., on the forms's onOpen event.

Many thanks for the reply, Scott.

Andy
"Scott McDaniel" <scott@NoSpam_Infotrakker.comwrote in message
news:hq********************************@4ax.com...
>On Mon, 23 Jul 2007 16:56:10 GMT, "ARC" <an**@andyc.comwrote:
>>>Hello all,

I didn't use to have this problem in Access 97, but in 2007 (and maybe
other
versions of access after 97), if you have a form that has a subform, and
you
click the close button, you always get the following dialog:

"Save changes to the following objects?"

The only time you'd get this prompt would be if you make Design changes
to your objects. I'm not sure why setting your
.SourceObject to a blank object would stop this message, however. Review
your code and make sure you're not making
design changes in code.
>>>
I tried putting a saverecord command prior to the close, but that had no
affect. I have found a work around, but maybe I am making this too
difficult?

What I do is to put code on the close button that reassigns the
sourceobject
of any subforms to a blank form, such as:

me!subParts.sourceobject = "subBlank" 'subBlank is my form that is
totally blank, free of code and controls, etc.
docmd.close acForm, "fParts", acSaveNo

The above 2 lines is the only way I've found to prevent the Access prompt
from popping up.

Is there an easier way? It's kind of a pain to do this, and if the user
clicks the 'X' to close, they'll still get the save prompt.

Many Thanks,

Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com


Jul 24 '07 #4

P: n/a
On Tue, 24 Jul 2007 17:39:41 GMT, "ARC" <an**@andyc.comwrote:
>I just tested and commented out my code for the dates, etc., and it still
comes up. On the subform, I'm setting the .columnhidden property of certain
fields based on setup options as well, so that is probably triggering the
save prompt. I guess I'm stuck, as I have to have the setup options work
when a form opens.
I use .ColumnHidden in some of my 2000+ stuff, and don't get the prompt to save changes.

Wonder if importing to a new, blank database would sovle the issue ... it's worth a try, and anytime I convert one I
always do that for good measure.
>

"ARC" <an**@andyc.comwrote in message
news:PI*****************@newssvr13.news.prodigy.n et...
>Hmmm...

The only thing I could find is that I'm running a function when a form is
opened that resets the date format for any date fields (this is to
accomodate the differing date formats especially in the UK and Australia).
Also, this same function will hide fields where they have selected not to
use a particular feature, etc.

I got the idea to use a blank subform on close, because it would prompt to
save the form object, and all subform objects on close. So if I set the
sourceobject of the subforms to a blank form, then close with a AcSaveNo
command, I don't get the popup.

Again, I never had this problem in Access 97.

Speaking of date fields... I wonder if it's still necessary in Acc2007 for
me to have the code for date fields to cover different country settings?
For example, if the user was in Australia, they would set their date
setting in a setup screen to : "dd-mmm-yyyy", so in code, I would set the
.format of a control to "dd-mmm-yyyy", etc., on the forms's onOpen event.

Many thanks for the reply, Scott.

Andy
"Scott McDaniel" <scott@NoSpam_Infotrakker.comwrote in message
news:hq********************************@4ax.com.. .
>>On Mon, 23 Jul 2007 16:56:10 GMT, "ARC" <an**@andyc.comwrote:

Hello all,

I didn't use to have this problem in Access 97, but in 2007 (and maybe
other
versions of access after 97), if you have a form that has a subform, and
you
click the close button, you always get the following dialog:

"Save changes to the following objects?"

The only time you'd get this prompt would be if you make Design changes
to your objects. I'm not sure why setting your
.SourceObject to a blank object would stop this message, however. Review
your code and make sure you're not making
design changes in code.
I tried putting a saverecord command prior to the close, but that had no
affect. I have found a work around, but maybe I am making this too
difficult?

What I do is to put code on the close button that reassigns the
sourceobject
of any subforms to a blank form, such as:

me!subParts.sourceobject = "subBlank" 'subBlank is my form that is
totally blank, free of code and controls, etc.
docmd.close acForm, "fParts", acSaveNo

The above 2 lines is the only way I've found to prevent the Access prompt
from popping up.

Is there an easier way? It's kind of a pain to do this, and if the user
clicks the 'X' to close, they'll still get the save prompt.

Many Thanks,
Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com

Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
Jul 24 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.