Fill field of one table with count from another

F

FishMan

Hi
I have two tables, joined by BoxNumber in a one to many relationship,
with fields:
Table1
BoxNumber/FridgeLocation/NumberOfSamples
Table2
SampleNumber/BoxNumber/DateOfCollection/SampleType/etc

I want the NumberOfSamples field in Table1 to count up the number of
records in Table2 which have the corresponding BoxNumbers, i.e. Table1
should look like:

BoxNumber/FridgeLocation/NumberOfSamples
1/A/49
2/B/15
3/B/37 etc

I can build a count query that gives output as required, but I want the
actual table to have the correct counts in the right field.

Pretty new to Access, so point and click rather than code if possible!
FishMan
 
R

Rick B

You should not do this. You should build that count on the fly when you
need it. Your table would never be accurate. What would prompt that number
to update if a sample were added or deleted?

It is not normal datbase design to store a calcualted number that can
change.
 
F

FishMan

Yes, I see the point of this, as I said,I am a newby! Will rely on the
query instead. Thansks for the info.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top