Update all records in subform from main form automatically

  • Thread starter Thread starter Sierras
  • Start date Start date
S

Sierras

I have 2 tables which I am using with a form and subform that shows
storage boxes and their contents.

Table 1 has the box no and the location
Table 2 has the box no and the contents

The main form shows the box no and location
The subform has the contents of that box.

This works fine, but what I would like the form to do is if I modify
the box number in the main form, that all the records in the subform
get modified automatically.

For example, if box 1 has 3 items and I change the number of box 1 to
box 2 in the main form, I would like the three items that were in that
box to now get updated as well to box 2. The only way I can do this
now is either change each record in the subform idividually or do it
in the table itself.

Anyway to do this automatically??
Thanks.
 
-----Original Message-----
I have 2 tables which I am using with a form and subform that shows
storage boxes and their contents.

Table 1 has the box no and the location
Table 2 has the box no and the contents

The main form shows the box no and location
The subform has the contents of that box.

This works fine, but what I would like the form to do is if I modify
the box number in the main form, that all the records in the subform
get modified automatically.

For example, if box 1 has 3 items and I change the number of box 1 to
box 2 in the main form, I would like the three items that were in that
box to now get updated as well to box 2. The only way I can do this
now is either change each record in the subform idividually or do it
in the table itself.

Anyway to do this automatically??
Thanks.
.

Reply,

One suggestion is that you create an extra field showing
the value of the box when (on Current Record)

When the box no on the form (After Update) you could run
a update query that finds all recods from the extra field
your created then update it to the new no in the current
record.

Hopes this helps.

Heed any more help just ask.

Regards

Ian
 
Thanks Ian,
I'm not sure what you mean by 'the value of the box'
I have an autonumber for each box in the first table. Could this be
the value of the box?
Also, will the update query update all the values in the second table
or will it only show these updated values in the query?

Thanks again...
 
Back
Top