Discussion Locked

Access -- refresh another form's subform

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am working on an Access database to track monthly circuit costs. I have a form (I'll refer to it as the main form) on which the auditor can select the account and the invoice date. This updates the query behind the subform on this form to show theauditor only what billed by circuit on that account on that month.

Next, the auditor can click on a specific circuit on the subform which opens second form prompting for the circuit's disconnect date. This form is connected to an update query that assigns that circuit the disconnect date just entered. The form closes and the auditor sees the main form with all the circuits on it but the disconnect date is still null because the query behind the subform does not automatically refresh.

Howdo I update the subform on the main form from the disconnect date entry form?

Additional info:
I have not been able to enter the disconnect date directly into the subform on the main form because that field is a part of a group by query that is showing several fields in the subform from multiple tables. (It is summing up the charge level detail to the circuit level.)

3 replies

by roc180

Use the following code to refresh your subform. Place the code in the on close event of the form that updates circuit's disconnect date.

Frm_Main!SubFrm_Name.Form.Requery

Good Luck

Neal Martinelli

by brettmo

Neal,

Thanks! I had to add "Forms!" to the beginning of what you suggested, but you lead me to the correct answer.

100 Points to you!

Regards,
Brett

I used this line to update the specific subform data from another form.
Forms!frm_Main!frm_Subform.Form.Requery

This discussion is closed to new replies.