X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
   Reply to this topicStart new topic
> Refresh subform    
post Apr 20 2010, 12:50 PM

Posts: 10
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.
Any suggestions?
Go to the top of the page
post Apr 20 2010, 01:00 PM

Utterly Banned
Posts: 7,038
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.
Go to the top of the page

Custom Search
RSSSearch   Top   Lo-Fi    20th June 2018 - 04:27 AM