Full Version: Confirmation On Each Row Update
UtterAccess Discussion Forums > Microsoft® Access > Access Automation
jokeme71
I have an update query that updates the records of one table by the contents of another for 6 specific fields.

Each time a record is updated via this update query I would like a message box to appearthat shows the old value and the new value for the 6 fields that gives the user the option to accept the change or flag the change for further review.

I figure I have to use a loop or two but am not sure how to accomplish this.

Any thoughts? Suggestions?
HiTechCoach
You could use a a recordset to loop through the records with the data to be updated and then display the data to the user to confirm. If accepted, you would then create an Update query with VBA and then run it to update the single record. This would continue until all record had be read

IMHO, your approach is not very user friendly. I would use a form that displays all the reords and then let the user pick the records that want to update. Then update all the records at once.

Edited by: HiTechCoach on Mon Apr 9 14:36:54 EDT 2007.

Edited by: HiTechCoach on Mon Apr 9 14:42:24 EDT 2007.
jokeme71
Very good point and thanks forthe quick response. I can exactly waht you are saying. Just for my knowledge though... if the user reviewed the message box and found the data incorrect how would I write the code to update a field for just that specific record from the recordset?

I am working the form solution but can see where I may want to use the message box method for a simple compare down the road that deals with say a bulk record update.
HiTechCoach
QUOTE
if the user reviewed the message box and found the data incorrect how would I write the code to update a field for just that specific record from the recordset?

You have to do it one record at a time. You get the first record to with the data to be updated, Ask to update , is yes, then run an append query for just that ONE record by creating an SQL statement to update the single record, get the new record and repeat the process one record at a time.

I have an example in the Utter Access Code archive forum for "Batch Printing" that may give you some guidance.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.