By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,680 Members | 1,890 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,680 IT Pros & Developers. It's quick & easy.

Update sub-form on tab from field

P: n/a
I have a sub-form(company name & address) that is connected to my
contact listing. When I change the contact, it doesn't update the
subform until I close the main form or refresh. Is there a way to make
it update when I tab out of that field?

Thanks.

Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"Rosy" <kr****@portlite.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I have a sub-form(company name & address) that is connected to my
contact listing. When I change the contact, it doesn't update the
subform until I close the main form or refresh. Is there a way to make
it update when I tab out of that field?


Could you clarify? I'm not sure I understand what you are doing and
expecting.

Does your Subform Control use the LinkMasterFields and LinkChildFields to
synchronize with the Record in the main Form? Do you mean when you move to
another Record in the main Form that the Subform is no longer synchronized?
If you use the LinkMasterFields and LinkChildFields, then it should
synchronize.

If you are displaying the same data in the main Form and the Form embedded
in the Subform control, and change some data in the main Form, that is a
different situation. If so, give additional details and perhaps someone can
assist.

Larry Linson
Microsoft Access MVP
Nov 13 '05 #2

P: n/a
Here is the code that I use. I have a subform that updates off another
subform. This updates the secondary subform and takes me to a new
record in the primary subform. I had to combine several suggestions
from others that posted to figure this out.

1. Copy and paste the info below into the last field you update in the
after update. It will obviously be in between the Private sub and the
End comments.
Me.Requery
DoCmd.GoToRecord acForm, "Yourmainformname (not subform in between
these quotations", acNext
DoCmd.GoToRecord acForm, "Yourmainformname (not subform in between
these quotations", acPrevious
RunCommand (acCmdRecordsGoToNew)

2. Copy the text below into the primary or only subform properties (if
you are not using a subform within a subform don't worry about this).
Me.Requery
DoCmd.GoToRecord acForm, "Yourmainformname (not subform in between
these quotations", acNext
DoCmd.GoToRecord acForm, "Yourmainformname (not subform in between
these quotations", acPrevious

On the first one, it will make the main form go to the next record and
then back. After that it will automatically go to a new record within
the subform.

The 2nd one is because I use a subform within a subform to check for
linked data between records, ie same bank account, address, vehicle,
etc. If you don't do this, then it is of no use. It basically updates
my second subform if I was to delete something from the main subform.

I hope this helps, it drove me nuts for a while.

armydatabase.com

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.