how to get rid of the prompt for saving changes | | |
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, | | | | re: how to get rid of the prompt for saving changes
On Mon, 23 Jul 2007 16:56:10 GMT, "ARC" <andy@andyc.comwrote: Quote:
>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. Quote:
>
>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 | | | | re: how to get rid of the prompt for saving changes
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:hqkba35edgq098aahhkqetd8r34860ovgs@4ax.com... Quote:
On Mon, 23 Jul 2007 16:56:10 GMT, "ARC" <andy@andyc.comwrote:
> Quote:
>>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.
> Quote:
>>
>>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 | | | | re: how to get rid of the prompt for saving changes
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" <andy@andyc.comwrote in message
news:PIqpi.10611$eY.9951@newssvr13.news.prodigy.ne t... Quote:
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:hqkba35edgq098aahhkqetd8r34860ovgs@4ax.com... Quote:
>On Mon, 23 Jul 2007 16:56:10 GMT, "ARC" <andy@andyc.comwrote:
>> Quote:
>>>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.
>> Quote:
>>>
>>>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 >
>
| | | | re: how to get rid of the prompt for saving changes
On Tue, 24 Jul 2007 17:39:41 GMT, "ARC" <andy@andyc.comwrote: Quote:
>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. Quote:
>
>
>"ARC" <andy@andyc.comwrote in message
>news:PIqpi.10611$eY.9951@newssvr13.news.prodigy.n et... Quote:
>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:hqkba35edgq098aahhkqetd8r34860ovgs@4ax.com.. . Quote:
>>On Mon, 23 Jul 2007 16:56:10 GMT, "ARC" <andy@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 |  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,419 network members.
|