Form continually Saving. Can't stop Saving Data


I am attaching a copy of the form inside the DB so we can see it.

I can't stop this form from Saving the data even if I cancel the record on the form.  Can't figure out why?

this has been driving me batty for the last few days.

I hope someone can tell me what I did wrong....

frmLogin:  18 = 1
Password: 123

part of the BackgroundLog Form

BackgroundLog should startup.
Ernest GroggSecurity Management InfoSecAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I suspect VBA code is used? (Currently blocked by password, hence, can't really tell what's going on).
Gustav BrockCIOCommented:
You probably save the record somewhere after entering data or entering/exiting a control.
Can't tell, as the code is password protected.

Ernest GroggSecurity Management InfoSecAuthor Commented:
Sorry forgot to remove that....
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
I'm guessing it's because there's a subform. Access will save the data on the main form when you move to the subform, and will save data on the subform when you move off the subform.

You can use the Form's BeforeUpdate event to stop the save. To do that, add a variable in the General Declarations section of the form (name it fSave, a Boolean variable), then do this in the BeforeUpdate event:

If Not fSave Then
  Cancel = True
End If

In the form's Current event, be sure to reset that value:

fSave = False

Now in your Save button, set the value to true:

fSave = True

When the acCmdSaveRecord call runs, the Form's BeforeUpdate event will run. Unless the user has clicked the "Save" button, they'll not be able to exit the subform unless they cancel their changes via the Esc key.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ernest GroggSecurity Management InfoSecAuthor Commented:
Seems to work great!  Thanks so much!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.