Best practice for saving Form data to 2 tables. (1 Viewer)

IannWard

Registered User.
Local time
Today, 06:08
Joined
Feb 19, 2015
Messages
30
Hi All.

I have an asset tracking database. Table 1 is used for tracking asset information and is often edited using a search form and submitting any changes. I want to create another table so I can keep a count of asset faults. As the Faults field in table 1 changes as and when a device is repaired, sent back out but then returns with a different fault, I have created a second table to save this info. When I make changes in the form, I want to update the Fault field in table 1 but also add an entry in table 2 allowing me to then query the total number of a particular fault at a later date.

What is the best way to copy the data from several fields to another table when editing table 1?

Hope this makes sense.

Thanks in advance
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:08
Joined
Oct 29, 2018
Messages
21,358
Hi. I will go ahead and say it even if you probably wouldn't want to hear it. It is against best practice to store duplicate information in multiple tables. If you want to keep track of the asset faults, it's recommended you create a child table for it. You would then just need a foreign key in the child table to represent all the information you need from the asset table. I hope it makes sense...
 

June7

AWF VIP
Local time
Yesterday, 22:08
Joined
Mar 9, 2014
Messages
5,424
Right, don't save fault info in table 1, use related dependent table for fault history.
 

Users who are viewing this thread

Top Bottom