Not updating the underlying table when a control is bound

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

Guest

I have a form with controls (mainly text boxes) that are bound to a query.

Is it possible to allow a user to change the data in one or more controls
but for the action to trigger an event procedure rather than updating the
underlying table? To be clear, I want to allow the change to be made in the
control but stop it updating the underlying table.

The only way I can see is to make the control 'unbound' but then I can't
display the records extracted by the query.
 
Actually, you can create a recordset that returns all the values, then
"load" the unbound controls with their respective values. Since the
form/controls are not bound, there's no issue with changing them. Then you
can evaluate whether or not to modify the underlying record.

Or, just add code to the form's BeforeUpdate event to do your testing. That
way, you can keep the form bound to the data source.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Hi Jeff,

Thanks for the guidance.

When you talk about "loading" the controls with their values, how is this
done?

Also, is this more complicated for a continuous form? (the form I have is
continuous)

Thanks
 
I guess I have a (perhaps unfounded) concern. If you user is looking at
data retrieved from the database, and making changes to it, and your form is
not updating the database, won't your user get confused?

Why do you feel your user has to make changes that your application will not
preserve? That doesn't seem too friendly <g>.

Instead of loading up the (unbound) controls on a form, have you considered
using a listbox to display the information you want the user to consider?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Jeff,

Thanks once again and sorry, I should have explained things better.

The table contains project issues that are updated on a weekly basis. I need
to hold a copy of each record following an update so I can produce snapshot
reports at different points in time.

What I'm trying to do is to work out a way of presenting the most recently
updated record on the form and if someone updates it further, to store a new
record with a new 'lastupdated' date. So, the table will hold a series of
records for the same issue, all slightly different and all with a different
'lastupdated' field. At present, if the record is updated on the form, it
simply updates the existing record. It does not add a new one. Also, what I
want to avoid is the user having to re-key a lot of info about the issue when
much of it will stay the same - hence the idea about storing the change in
the control and then using an event procedure to add a new record to the
table.

I hope this explains things more clearly. Is there a way I can do this?
 
If all you are trying to do is allow the user to view data, but not make any
changes, set the form's AllowEdits, AllowDeletions, and AllowAdditions
propeties to No in design view.

I would be very curious to know why you would allow changes that will not be
saved to the table.
 
Thanks for your contribution.

I've explained what I'm trying to achieve in the last reply to Jeff. If you
are able to throw any extra light on how to go about it I would be grateful.
 

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