How to update a current record in code, and avoiding write conflict with the datasheet record.
Posted on 2008-06-17
I currently have a Access 2003 application that has some strict design parameters.
Up the top of the screen is a datasheet showing each record, and it is editable directly into fields.
At the bottom is a series of tabs, with the same fields as above divided among them.
An update in any field will update the corresponding field.
My issue is that I have a table with a 3 field key.
The user always gets a 'primary key error' as they try to enter in new values for the key fields. Obviously a user cannot simultaneously enter 3 fields at the same time. I dont want the error message appearing to the user.
My solution was to have a small popup, when a key field got focus which allowed the user to enter all 3 fields on an unbound popup, then I would save the the key via CurrentDB.Execute. It seemed to work okay until i then went to another non-key field or changed records. I then got the 'Write Conflict' error..argh.
Can someone give me some direction on how to tackle the entry of a multiple field key into a datasheet view. (sans error messages)
Please dont suggest an Autonumber or ID field as the solution, as it is not an option.