entering data on the form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi,
I would like to know how I can set my form so that the records don't get
saved automatically.
I have a form where you can enter and edit data but the problem is that I
have novice users so the first thing they do is automatically think that the
form is like a search form and start entering data which gets saved
automatically when you close it or use the scroller on the mouse.
So i need not the data to be saved automatically until they havent hit the
save macro button on the form.
Thanks in advance.
 
Kushum said:
hi,
I would like to know how I can set my form so that the records don't
get saved automatically.
I have a form where you can enter and edit data but the problem is
that I have novice users so the first thing they do is automatically
think that the form is like a search form and start entering data
which gets saved automatically when you close it or use the scroller
on the mouse.
So i need not the data to be saved automatically until they havent
hit the save macro button on the form.
Thanks in advance.

You cannot change the AutoSave behaviour without going to an unbound form, but
you can use the BeforeUpdate event to raise a "Do you want to save your
changes?" prompt and cancel the update if they say No.

If MsgBox("Save Changes", vbYesNo) = vbNo Then
Cancel = True
Me.Undo
End If

This strategy has issues and is generally annoying to users who do know what
they're doing. A better strategy is to lock all controsl on the form by default
and then provide an [Edit Record] that unlocks them. That should eliminate
accidental changes.

Ultimately though users who are allowed to make edits have to be trained and
have to NOT be morons.
 
On the before update event of the form, you can enter the code
If MsgBox("Save", vbOKCancel) = vbOK Then
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Else
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
End If

That will prompt the user if he/she wants to save the record, if no, the
changes will undo.
 

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

Back
Top