Bound control doesn't update table

N

Nan Hauser

I have a purchase request (PR) form that consists of a main form containing
the PR data that is bound to the PR table and a subform containing the items
ordered that are bound to the Item table. The subform code puts the total of
the items into the main form control that is bound to the PR table "Total"
field. The form is opened as acFormAdd when generating a new PR or
acFormEdit when editing an existing PR. When the form is opened in edit
mode, it works perfectly. When the form is opened in add mode, the total
appears on the main form but the PR table "Total" field isn't updated. So
when I press the print button, the report shows a total of 0. I do a requery
before I open the report, and it's still a 0. I don't understand how I can
see the total on the form in a control that is bound to the PR table, but the
data isn't in the PR table. I open the table and all of the other data from
the main form is in the table. What do I have to do to get this to work? I
know you shouldn't save totals, but we have so many PRs that are almost
identical except for the total that it is very helpfull to me.
 
M

[MVP]

I have a purchase request (PR) form that consists of a main form containing
the PR data that is bound to the PR table and a subform containing the items
ordered that are bound to the Item table.  The subform code puts the total of
the items into the main form control that is bound to the PR table "Total"
field.  The form is opened as acFormAdd when generating a new PR or
acFormEdit when editing an existing PR.  When the form is opened in edit
mode, it works perfectly.  When the form is opened in add mode, the total
appears on the main form but the PR table "Total" field isn't updated.  So
when I press the print button, the report shows a total of 0.  I do a requery
before I open the report, and it's still a 0.  I don't understand how Ican
see the total on the form in a control that is bound to the PR table, butthe
data isn't in the PR table.  I open the table and all of the other datafrom
the main form is in the table.  What do I have to do to get this to work?  I
know you shouldn't save totals, but we have so many PRs that are almost
identical except for the total that it is very helpfull to me.

I am not sure I understand all (how the subform is linked with main
form?), but I assume you will need to save record(s) before getting
Total - as it works in Edit mode, but not in Add mode.

Regards,
Branislav Mihaljev
Microsoft Access MVP
 
N

Nan Hauser

Thanks, I'll try that.

I am not sure I understand all (how the subform is linked with main
form?), but I assume you will need to save record(s) before getting
Total - as it works in Edit mode, but not in Add mode.

Regards,
Branislav Mihaljev
Microsoft Access MVP
 

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