annoying save prompt when closing forms

sal

Registered User.
Local time
Today, 11:11
Joined
Oct 25, 2009
Messages
52
I have a main data entry form with several subforms and recently I started getting mysterious Save Prompts when closing the forms after entering data. But these prompts are regarding form design not data.

I went through my code looking for any save prompt properties but found none. I did however find a hanging temporary form in the Visual Basic work space that does not appear with the forms in the navigation bar. And I cannot figure out how to get rid of it. I can actually open it from the visual basic workspace but it does not save to the forms list.

Coding the basics is difficult enough for the novice, but trying to troubleshoot these strange errors is frustrating.:confused:
 
what sort of save prompt

is it just the "Access cannot save the record at this time" message?
 
I have a main data entry form with several subforms and recently I started getting mysterious Save Prompts when closing the forms after entering data. But these prompts are regarding form design not data.
Sounds like a "do you want to save changes to the design of xxx" kind of message?
 
If you are certain there are no changes then why not hide the normal close 'x' in the corner and use a command button to run:

DoCmd.Close acForm, "frmFormName", acSaveNo
 
Offending Code?

This Save Changes prompt occurs after data is entered into the form but it is a save changes to form prompt for some of the subforms and one table which I have not entered data into.

My main form is set up so that the subforms are inactive until the necessary data is entered into the main form:

Private Sub Form_Current()
Me.TabCtl141.Enabled = Not Me.NewRecord
Me.SGS_Count_Data_subform.Enabled = Not Me.NewRecord
End Sub

Once the data is entered I have a requery from abutton that activates the subforms:

Private Sub Command255_Click()
Call Requery_Current_Record
End Sub

Then a return to the working (last record):

Private Sub Requery_Current_Record()
Dim lngRecNo As Long
lngRecNo = Me![SurveyID]
Me.Requery
Me![SurveyID].SetFocus
DoCmd.FindRecord lngRecNo, acEntire, , acSearchAll
End Sub

Everything works as needed but the Save prompt every time the form closes is very disconcerting. I would really like to stop it from happening to the users.

The only place I have any Form close properties are on forms which are not opened at the time this problem is occurring and I have changes the save prompt property on close to NO.:cool:
 
* Is there anywhere in code that opens the form in design view?
* How is your database split? Does each user share the same front end or otherwise?
* How is the form opened? Can we see the code.
 
To my knowledge my code does not open any of these forms, but it does requery them. The database does not have a front end. It is a stand alone for remote users.

:)I am attaching the DB here in case anyone would be willing to look it over there is a bit of code in various places and a few embedded macros.

There are fields with Asterisks that are required, then the user clicks on the key icon to requery the record and activate the sub forms, which are rules for editing. But once the key is clicked the save prompt will follow any attempt to close the main form.

Right now I am guessing that the requery of the main form somehow dirties the subforms, causing the save prompt. Is this likely? Is there a way to fix it?
 

Attachments

Lots of bad db practices there such as referencing a value from a control on the subform to filter the values displayed in a combo box on the parent form. That kind of link is illogical. Your form was also a bit corrupt so those sort of things may have been the cause of the corruption.

Lastly, your code is uncompiled, and even trying to compile it throws up too many errors. Yet another bad practice.

In relation to the problem you need to create a form for Sample data and use it as the Source Object of the subform located in one of the tabs. I have done it and attached it.
 

Attachments

I really appreciate the help. I think I had a Sample Form, but lost it copying it back and forth from test DB's to the final application.

I also appreciate your critique of my project. I'm not a programmer, just a biologist trying to program. I have lot's of parked code, possibly some redundant code etc. I will try to take your comments to the next step and clean things up.

I notice you were able to get rid of the temporary form in the VB workspace that had been listed as a class object. Did you just create a new db and import the objects from the old one?

Thanks again. I always get help on this forum.
 
I'm not a programmer, just a biologist trying to program.
Alright then :)

I have lot's of parked code, possibly some redundant code etc. I will try to take your comments to the next step and clean things up.
To compile your code, in the VBA editor click the Debug menu, then Compile. It will highlight all the code that has problems - syntactic errors and so forth.

I notice you were able to get rid of the temporary form in the VB workspace that had been listed as a class object. Did you just create a new db and import the objects from the old one?
That was what I did and got rid of all the junk.
 
it would be useful to see the EXACT message you are getting

there are two sorts of save messages

1. The data cannot be saved. You can easily (and inadvertently) set up a form that partially sets some data in a new record - When you close the form, Access tries to save the record, but this may then fail becuase you have invalid fields, or constraints violated.

2. The form has been redesigned and the message refers to saving forms design changes.

I struggle to see how you could keep getting form design change messages - so I expect the problem is to do with the way your form is set up, and the messages are about saving data.
 
The message is re form design changes, not record changes.

It was sorted in the db I posted.
 

Users who are viewing this thread

Back
Top Bottom