I have a table in my data base where I keep some Customer information, standard stuff like ID, Name, Contact, Address, etc. Now we need to keep track of When, Who and What had changed to this table. I guess there were some problems with people changing info and now some people what to know who did it in case something wrong was entered. Customers are pretty study, so no new ones added and no deleting. So I have another (Log) table with fields like: When, Who, ID, FieldName, OldInfo, and NewInfo. And I have some logic to write any changes that are made to my Customer table, and this Log table will be used to generate a report with any and all changes to the Customer table. When, Who, and ID is not a problem, but in my FieldName I have a name of the Field in my Customer table that – as you know – may not mean anything to my users. Also, in my OldInfo and Newinfo fields I end up with information like 1 and 3 which are in yet another (look up) table, so 1 and 3 have some meaning to me and to the program, but not much to my users.
So I need to re-think and re-do my approach to the Log table. Instead of FieldName (from my Customer table) I need something more descriptive. And instead 1 (in OldIfo) and 3 (in NewInfo) and need to have information from my look-up table, like 1 is ‘Mr.’ and 3 is ‘Miss’, so that’s the information I need to write to my Log table. I am thinking about writing to my Log table what users actually see on the Form. I usually have a label describing the field, something like:
[tt][blue]
Address1:[/blue] [123 Main Street][/tt]
Where Address1 is a label named lblAddress1 and [123 Main Street] is a text box named txtAddress1. There also could be combination of a label and a drop-down combo: lblArea and cboArea, for example.
I think I may want to loop thru my controls on the Form, remember what was in text boxes and drop-down combos, and compare it to values in these controls when Update command button was clicked, and detect the changes and write them into the Log table. I just don’t know if that’s the best approach. So instead of re-inventing the wheel, I thought I would ask here how this is done by other people.
Any suggestions?
VB6 with Oracle
Have fun.
---- Andy