every time i change a feild on a table or form i need it to be saved. I need it to be saved into a history table without it changing the previous history of that feild
OK so do you want to have all of the records in the same table each time a change is made.<br>
If so then it is easiest done with an edit button and a save button.<br>
Before the user makes a change they click an Edit button which actually is a "SaveAs Duplicate" button<br>
So it creates an exact copy of the record leaving the original intact and positioning them on the new record.<br>
After the user changes something in the New record have them press the (save button) to save the New record.<br>
<br>
Both the Dupicate and the Save record buttons are in the button Wizards under "Record Operations" in the "Categories" list<br>
A user may neglect to use the button properly. If you need to be sure, you may want to disable the ability to update a record just in case. You can do this through security if it is set up or you could code it in the form's events. <br>
<br>
An alternate approach would be to put code into the BeforeUpdate Event to save the old data as an Add to your History table. If the values are bound you can grab them with the OldValue property. You'd probably want to save the current date and time so you can easily identify the order of the changes.
What we need to do is to save to a history file the codes and dates and what was done to certain machine at a certain time and save the information to be looked over at one time. That way we can see what has been run on the machine and what maintance has been done. For example, we need something that looks like this:<br>
<br>
Code: Date: Discription:<br>
<br>
12345 2/6/2000 ran water test<br>
69780 2/8/2000 ran batch of product<br>
<br>
and so on....<br>
We need to be able to save the form to read like this. PLEASE HELP! The program is already 17.5 megs big and we need it for work. Thank You,
You need 2 tables <br>
In table 1 store machines with fields like<br>
MachineID ¦ Name ¦ Dept ¦ etc....<br>
12345 ¦ xxxx ¦ yyyy ¦ fadfsfsfs<br>
69780 ¦ zzzz ¦ aaaa ¦ fsdfsfadsf<br>
<br>
in table 2 have these fields (this is the Maintenance table)<br>
MachineID ¦ Date ¦ Maintenance etc.....<br>
12345 ¦ 2/6/2000 ¦ran water test<br>
69780 ¦ 2/8/2000 ¦ran batch of product<br>
<br>
So every record in the Maintenance table can be for any machine and any time.<br>
Every time one tiny little thing is done to any machine a NEW record is added to the Maintenance table.<br>
Now you can have a "main" form and a "sub form" on it.<br>
Here's how:<br>
Create a Machine table and an a Maintenance table.<br>
Single Click on the Machine table and click the "Insert" menu then click "AutoForm" It will create a form in 2 seconds already connected to your machines.<br>
Open your new form in "design" view.<br>
Make sure your Wizard button (button on toolbar with wand and magic dust) is depressed.<br>
Create a sub form below or to the right of your (Machine fields)<br>
The link will be MachineID or your Child/master field is MachineID.<br>
(Sorry Mine won't work right now I need to re-boot.)<br>
But anyway once you have that set up view your form and you will see one machine and in your subform is where the Maintenance records are for that Machine. (you can have as many as you want.<br>
You can add a record in the subform and it will link to that MachineID automatically, there everytime you add a new Maintenance record.<br>
Click on the record navigation buttons (way down at the bottom) to the next "MACHINE" and you can see it's Maintenance records.<br>
<br>
OK<br>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.