UtterAccess.com
We have detected that you are using an unsupported web browser. We recommend you to upgrade your web browser to get the most from UtterAccess forums.
Why should and how can I upgrade?
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Refresh subform    
 
   
Jimmymac
post Apr 20 2010, 12:50 PM
Post #1

New Member
Posts: 10



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
 
+
Bob_L
post Apr 20 2010, 01:00 PM
Post #2

Utterly Banned
Posts: 7,038



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
Me.YourSubformControlNameHere.Form.Requery
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
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Search  ·  Go to Top  ·  Lo-Fi Version Time is now: 24th October 2014 - 11:48 AM

Tag cloud: