Apr 20 2010, 12:50 PM
Joined: 4-March 08
I have a purchase order form. One of the fields is [Supplier]. It is the linked field for the subform. The subform is product information, but is filtered so that it only shows products supplied by the [Supplier] on the main form. I want the subform to refresh after the [Supplier] field updates. I used Me.Refresh, but that only refreshes the main form. I can get it to do what I want by selecting "Refresh All" from the menu, but that command is not an option in the VBA editor.
Apr 20 2010, 01:00 PM
Joined: 5-December 02
Just a note to you.
efresh only updates records that existed in the record source that was originally loaded. It does not add new records or remove deleted records. So most of the time you want REQUERY to get everything updated.
The code to requery a subform is
And YourSubformControlName is the name of the control on the main form which houses the subform, not the subform name itself (unless the control and the subform share the exact same name, which is okay). And the .Form. part is just as written which tells Access you want to do something with the subform itself and not the subform control.
|Search Top Lo-Fi||8th February 2016 - 12:53 AM|