Solved

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

Posted on 2013-01-30
3
277 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 47

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 47

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

739 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