Basic database design question

sumdumgai

Registered User.
Local time
Today, 05:10
Joined
Jul 19, 2007
Messages
453
I'm a beginner at this so please bear with me and help if you can. I'm on my way to implementing an Access database and have established some tables, a few queries and a form, much of it with help from boblarson of this forum. Basically, what I would like to give the user is something like the following. A split form is displayed. Half of it will display the bound table. The user should be able to filter this portion (datasheet) of the form but not change any values. When the user clicks on (selects) a row on this portion, the fields in the other half of the form are automatically changed to the values of the selected record. I have this much working so far.

Now, here's where I'm stuck. I want to allow the user to change the values in any one or more of these form fields, but I do not want the bound table to be updated yet. I want, instead, to implement an 'Update' button which the user would click to actually do the update, as well as a 'Cancel' button to allow discarding any field changes.

The 'Update' button is needed because some other checks will be made (VBA) before the update can continue. Also, I plan on implemented some sort of audit trail of changes.

Thanks for any suggestions and some button code examples if possible.
 
The most common way of handling validation is using the before update event of the form:

http://www.baldyweb.com/BeforeUpdate.htm

You can do the buttons bit, or use an unbound form, but the before update event is simplest.
 
Tried before update but it doesn't seem to give me the control I need (could be that I don't fully understand how to implement it). Are there any examples of coding a button? Thanks.
 
The problem is that Access by default will try to save the record if the user navigates to another record or closes the form. The before update event is going to fire anyway, and the methods I've seen involve a form level Boolean variable that is set to True when the form opens, and False if they click your save button. The before update event tests that variable and cancels the update if it's true (as simple as Cancel = VariableName).
 
Check out the programming for saving, undo and testing if a record is dirty [has been modified but not saved] in my old A Better Mouse Trap? sample which should help your quest.
 

Users who are viewing this thread

Back
Top Bottom