Form saves itself every time it is opened - HELP

C

CaptHFD

I have an unbound form with a large subform (form view) that saves itself
every time it opens. This started to happen when I added the subform to the
form. There is no code that tells it to save. The subform is rather large
(approx 30 ctrls or buttons) with a moderate amount of code (25 pgs when
copied to word). It takes approx 20 to 30 sec for the form to open. I know it
is saving as the help assistant (dog) pulls a flopy disc from his collar. Is
there any way to stop this from happening or am I working the wrong way with
the subform (I used the wizard)?? This happens both with windowsXP and
windows2000 Net version. I am utilizing Access version 2002-SP2 I have been
told by another person in this group that it does not normally save and I can
not figure how to stop this behavior.
I created a small unbound form with a small subform (very minimal code) to
check if size was a factor and this still saves itself when opening. It does
not matter if it is stored on the city intranet or working on my personal
laptop at home.
Thanks in advance.
Capthfd
 
A

Albert D.Kallal

I created a small unbound form with a small subform (very minimal code) to
check if size was a factor and this still saves itself when opening.

If you remove the code, does it stop saving?

And, if the answer to the above is yes, then start putting in the minimal
code one line at a time until you find the spot/reason the save occurs.

Also, are you taking about the data save, or the actual form being saved?

In a bound form, when the focus moves from the main form to the sub-form,
then a record save occurs (this is not the form being saved, but the only
the record data gets written). Of course, we are taking about bound forms
here. Further, the reason why ms-access does this is that your sub-form is
typically the "many" side of a one to many relationship, and thus you have
to save the "one" side before you start entering the many side.

Anyway, check if the the behavours you talk about occurs with no code. While
data saving is normal, the form part saving is not.

Then start adding tiny bits of code...you should be able to track this down.
 
A

Arvin Meyer [MVP]

the form from saving itself when it opens. TIA Ray (capthfd)

Merely opening a form will not save a record, even on a bound form, unless
you have some code running to do so. Look for code in the Open or Load
events.

To avoid saving after you have started your record, you will need to remove
the recordsource property. Open the property sheet for the form (make sure
it is the form that's selected) and delete the recordsource property value.
You will then need to open a recordset and write the record to the table in
code. Look up recordsets and the AddNew method of writing a record to the
underlying tables.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top