Table updating fields

tikkat3

Registered User.
Local time
Today, 09:10
Joined
Apr 10, 2007
Messages
66
It has been a while since I last set up a new database and I am having trouble with a main aspect of the table design. My database is to keep a log of all projects within the company. The area I am having trouble with is how best to set out key data within the table(s).

The following fields will refer to all aspects of the project (from its start to finish):- Job number (unique to the job), date order received, product code, end user, site name, project manager, etc.)

However, there is a second level which relates to all of the above information, but where there are variables, i.e. multiple visits to site etc. The fields for this section include: Date on site, Installation time, Men required, remarks, etc.

What I need is that the main job number remains unique, but that the individual site visits (second level) are linked into the job number and the top level information.

I have set up the top and secondary levels in separate tables and using relationships have linked the relevant fields. The main problem I have come up against is that even though I can set up a new project if the job number field from the top level table is used, the database will not accept the same data via the secondary level field (which is linked by one-to-many relationship to the top level). I.e. the top level data has to be entered before any multiple visit secondary level data can be added. I cannot get the database to do it all in one go.

The second main problem I have is related to the first. There is a 3rd table which deals with materials ordering. It has a main link to the above mentioned top level table - the job number. Despite the relationship being set up seemingly correctly, data is never sent over the the materials' table

I am afraid I have baffled myself and am lost. I hope the above makes some sort of sense.

Just to confirm, in the relationships for all fields, referential integrity and cascading ceckboxes have all been ticked.

I hope someone is able to help!
 
Data doesn't transfer like that. The usual way to enter related records is to use a form/subform set up with the one side in the form and the many side in the subform. Access subform fuctionality ensures that the parent/child records are updated.
 
Neileg, thanks for your quick response. Funny enough I have just this minute managed to come to the same result, when your post came in!

An ongoing problem is the last one I mentioned. The third table will not update and I cannot see why. Through the subform I am getting the error message "Index or Primary Key cannot contain a null value". There is no null value in the fields as far as I can see, and they are not Autonumbers.

Any ideas?
 
Found the problem! My own stupid fault in giving a field PK status when it is a field which will only get data later in the data entry process. The main form just needs to popluate it with core job data at this point!!!

Thanks for the help.
 

Users who are viewing this thread

Back
Top Bottom