R
Robin Hall
Is there a way of making the value of a field in one table dependent
upon the fields in another linked table?
I have (what started out as) a simple database to record returned
goods which has two tables. These have a one-to-many relationship;
one records the 'header' for each 'RMA' or set of goods (account no,
customer, location, date) and the other the 'lines' of the RMA.
They are linked through the autoassigned primary key of the 'header'
table, which is a four digit RMA number.
I have managed to set up the link with referential integrity so that
you cannot enter lines if the corresponding RMA does not exist.
What I am trying to do is have a field in the 'header' table which
counts how many lines in the 'lines' table match on the RMA number.
Is there any way to do this?
I have a suspicion now that I have considered the problem for a while
that I am taking the wrong approach (would I be better off not
including this information in the table but performing a 'count' of
matching lines in a form or report when I want to display the data -
otherwise am I trying to store the same information in two places,
which would be pointless ?) but I would be grateful to know whether it
can be done now that I have spent a while trying.
What I would really like to be able to do is write a form to enter RMA
lines which, when you enter the RMA number, will present you with the
next sequential line number for that RMA. I realise I have gone
sideways a little from that aim to the above question but I'm very
much a beginner and keep thinking of new questions
Thankyou for any advice,
Robin
upon the fields in another linked table?
I have (what started out as) a simple database to record returned
goods which has two tables. These have a one-to-many relationship;
one records the 'header' for each 'RMA' or set of goods (account no,
customer, location, date) and the other the 'lines' of the RMA.
They are linked through the autoassigned primary key of the 'header'
table, which is a four digit RMA number.
I have managed to set up the link with referential integrity so that
you cannot enter lines if the corresponding RMA does not exist.
What I am trying to do is have a field in the 'header' table which
counts how many lines in the 'lines' table match on the RMA number.
Is there any way to do this?
I have a suspicion now that I have considered the problem for a while
that I am taking the wrong approach (would I be better off not
including this information in the table but performing a 'count' of
matching lines in a form or report when I want to display the data -
otherwise am I trying to store the same information in two places,
which would be pointless ?) but I would be grateful to know whether it
can be done now that I have spent a while trying.
What I would really like to be able to do is write a form to enter RMA
lines which, when you enter the RMA number, will present you with the
next sequential line number for that RMA. I realise I have gone
sideways a little from that aim to the above question but I'm very
much a beginner and keep thinking of new questions
Thankyou for any advice,
Robin