Update a subform

B

Biju George

I have a form which records the daily despatch quantities. An individual
item can have different dispatch quantity at different date. I also have a
subform in this form which shows the 'sum dispatch quantity' against each
item. The subform is updated only after existing from that row/record.
My question is how can i update the subform 'sum despatch quantity'
immediately after entering the despatch quantity in the main form.
Any suggestion/response is appreciated.

Thanks/Biju
 
M

Marshall Barton

Biju said:
I have a form which records the daily despatch quantities. An individual
item can have different dispatch quantity at different date. I also have a
subform in this form which shows the 'sum dispatch quantity' against each
item. The subform is updated only after existing from that row/record.
My question is how can i update the subform 'sum despatch quantity'
immediately after entering the despatch quantity in the main form.
Any suggestion/response is appreciated.


You probably need to requery the subform. This would be
done in the main form's AfterUpdate event procedure:
Me.subformcontrol.Form.Requery
 
M

Marshall Barton

Biju said:
I have a form which records the daily despatch quantities. An individual
item can have different dispatch quantity at different date. I also have a
subform in this form which shows the 'sum dispatch quantity' against each
item. The subform is updated only after existing from that row/record.
My question is how can i update the subform 'sum despatch quantity'
immediately after entering the despatch quantity in the main form.


Please keep the correspondence on the newsgroups.
Unsolicited provate email is very likely going to get lost
amongst all the spam.

Instead of using the name with underscores, use the real
name of the subform control enclosed in square brackets:

Me.[Sum Of Desp Qty].Form.Requery

This is another good reason why you should not use names
with spaces or other funky characters.

The subform will update the sums if the main form record has
been saved. You will probably have to add some code to
explictly save the new value(s) to the table:
Me.Dirty = False
before doing the requery.
 
B

Biju George

Thank you Marsh.

Biju
Marshall Barton said:
Biju said:
I have a form which records the daily despatch quantities. An individual
item can have different dispatch quantity at different date. I also have a
subform in this form which shows the 'sum dispatch quantity' against each
item. The subform is updated only after existing from that row/record.
My question is how can i update the subform 'sum despatch quantity'
immediately after entering the despatch quantity in the main form.


Please keep the correspondence on the newsgroups.
Unsolicited provate email is very likely going to get lost
amongst all the spam.

Instead of using the name with underscores, use the real
name of the subform control enclosed in square brackets:

Me.[Sum Of Desp Qty].Form.Requery

This is another good reason why you should not use names
with spaces or other funky characters.

The subform will update the sums if the main form record has
been saved. You will probably have to add some code to
explictly save the new value(s) to the table:
Me.Dirty = False
before doing the requery.
 
Top