Subform slow to update

AmyB

New member
Local time
Today, 18:42
Joined
May 12, 2004
Messages
8
I wonder if anyone could offer some advice on a problem with a form & subform?

I have a main form, based on table PublicationOrders:
POrderID (pk)
EventID(fk)

And a subform, EventDisplay, based on table Events:
EventID (pk)
EventName

The main form and subform are linked on the field EventID and my master and child links are correct, as far as I can tell.

The field EventID on the main form is a combobox, bound to field EventID in the table PublicationOrders. It allows the user to select which event an order is being sent to. In the Afterupdate property of this combobox, I have the code: Forms!PublicationOrders!EventDisplay.Requery

I would like the subform to update to show the details of the event that has just been selected from the combobox. However, for some reason, on afterupdate, the subform displays whichever event was selected when the previous record was entered. If I close and reopen the form, it will right itself and show the correct event information that corresponds with the order.

Any ideas why it's doing this? I have searched here for a solution but can't seem to find anything that relates.
 
You may try using the requery sub on afterupdate of the mainform .

Public Sub RequeryList()

Dim ctlCombo As Control

' Return Control object pointing to a combo box.
Set ctlCombo = Forms!Yourform

' Requery source of data for list box.
ctlCombo.Requery

End Sub
 
Thanks for your help rak, but this doesn't make any difference. The subform display is still one record behind and only updates when I move to a different record or close the form.
 

Users who are viewing this thread

Back
Top Bottom