When do subforms update?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a subform displaying details in a popup form (a form in a dialog
window that is). When the form is first opened the subform displays the
correct information, but if the user changes the key field (in this case,
accountId), the subform does not update.

I trapped out changes in the AfterUpdate and did
"Me.PositionSubform.Requery", but nothing happens.

Anyone know how to make this work?
 
Maury said:
I have a subform displaying details in a popup form (a form in a dialog
window that is). When the form is first opened the subform displays the
correct information, but if the user changes the key field (in this case,
accountId), the subform does not update.

I trapped out changes in the AfterUpdate and did
"Me.PositionSubform.Requery", but nothing happens.

Anyone know how to make this work?

Don't let the user "change" the accountID on the main form, rather select it.

Step 1: Add a combo box to the main form using the wizard, and select "look
up a record based on the combo box" (or whatever verbage says the same
thing), and have that combo box be used to select the account ID.
Step 2: Be sure the linked field between the main and sub forms is the
account ID.

When the account ID is selected on the main form combo, the subform should
immediately update.
gm
 
:

Sorry for the tardy reply, I should check a little more often.
Step 1: Add a combo box to the main form using the wizard, and select "look
up a record based on the combo box" (or whatever verbage says the same
thing), and have that combo box be used to select the account ID.
Step 2: Be sure the linked field between the main and sub forms is the
account ID.

This is exactly what I did actually. The accountId is bound to a combo that
the user does the selection on. However, changing the selection in the combo
has no effect on the subform.

The combo in question also has an afterUpdate on it, the subform isn't the
only thing that gets set when the user selects the account. Could this have
something to do with it?

Maury
 
Ahhh, found it. You have to bind to the _control_ itself, not the value
inside the control. Kinda silly really, but I guess it tracks the updates
that way.

Maury
 

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

Back
Top