?
Solved

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

Posted on 2013-01-30
3
Medium Priority
?
279 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 earned 2000 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
ID: 38836616
You might also want to check out this page from Allen Browne's site
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

777 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