Can I save and edit record without auto save

  • Thread starter Thread starter Andrew Chan
  • Start date Start date
A

Andrew Chan

When I using form and table inserting or editing data, it save the change
automatically. Can I change this behavour, let say, user must click the save
button to the modification or insertion?
 
Andrew,

To do that you need to use unbound forms, and save the data through code.

HTH,
Nikos
 
Andrew,

Yes, you can, but it takes more code. Instead, you can use a bound form
for browsing (Allow Additions/Edits/Deletions > No), and add command
buttons on it for editing / adding / deleting records; delete just uses
a Delete query in code, deleting the v; edit opens an unbound form to
edit the record currently displayed on the bound form; add opens the
same unbound form to add a new record. This is what I usually do.

HTH,
Nikos
 
Thanks so much.
to create an unbounded form, is it simply create a form in design view,
paste text box controls then link to a table. (I found it doesn't work)
or copy those values from bounded form (use vba again in the unbounded form
open form event)?
 
to create an unbounded form, is it simply create a form in design view,
paste text box controls then link to a table
You don't link to a table at all; that's what being unbound is all
about. The idea is that whatever the user does in the controls on the
form doe not affect the table until a command button is pressed. The
code behind the command button open the table as a recordset, and
creates/edits a record as required.
or copy those values from bounded form (use vba again in the unbounded form
open form event)?
Yes, you would copy the values from the bound form controls if opening
the unbound form to edit a record. It does not necessarily have to be in
the unbound form's Open event, it might just as well be in the bound
form's command button's Click event, it works just as well either way.
 

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