Altering a field on a form - DB update or not?

M

MikeB

If I use VBA to set the value of a control (text box) on a form bound
to a table, is the update directly applied to the underlying record in
the table or does the update become effective only when I navigate
away from the record?

Similarly, when I use a combo box to set or alter the vale in a
control, is it immediate or deferred to another event takes place?
 
R

Rick Brandt

If I use VBA to set the value of a control (text box) on a form bound to
a table, is the update directly applied to the underlying record in the
table or does the update become effective only when I navigate away from
the record?

Similarly, when I use a combo box to set or alter the vale in a control,
is it immediate or deferred to another event takes place?

It is written to the table when the record is saved. There are numerous
events that automatically trigger a record to be saved. Navigating to a
different record is one of them. You can also...

Close the form
Requery the form (*)
Apply a filter (*)
Remove a filter (*)
Press <Shift-Enter>
VBA code - DoCmd.RunCommand acCmdSaveRecord
VBA code - Me.Dirty = False

(*) these actually trigger a save because they cause record navigation.
 

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