Solved

Make changes to data on Access form and keep original data in history table

Posted on 2013-01-30
3
278 Views
Last Modified: 2013-01-30
I have a form (myFormA) with about 30 fields where the end users enter product specs.

I want to create another form (myFormEdits) with the same 30 fields but it will allow the end users to edit any of the 30 fields, but I want to keep the original value in a history table (myTableHistory- it has 5 fields: ProductNumber, Spec, OriginalValue, Date, UserID ).

How can I do this so if the end user decides to change 6 out of the 30, it will know to only insert the 6 original values into  myTableHistory. I was thinking of possibly adding an "edit" button to all 30 and when the user clicks it, it will insert the original value into myTableHistory and update the main table with the new value, but it will be tedious to do this 30 times in code. Any better ideas?

Thank you in advance!
0
Comment
Question by:printmedia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 40

Expert Comment

by:als315
ID: 38836560
You can copy 30 records to temporary table, edit. Edited records can be compared with original data in query and only different records are saved to history table
0
 
LVL 48

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
ID: 38836610
@Alexey, 30 fields, not records.

@printmedia, You could use the Form_BeforeUpdate event, and loop through the controls, comparing the controls Value to the OldValue, and where the OldValue has changed, save that value to your table.  Although if you want to record any field changes, you would also need to record the field name in your table.  Not sure you need to save the new value, as it will be in your main table.
0
 
LVL 48

Expert Comment

by:Dale Fye (Access MVP)
ID: 38836616
You might also want to check out this page from Allen Browne's site
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question