Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 3rd, 2003, 02:50 PM
ppenn
Guest
 
Posts: n/a
Default SubForm Requery

Can anyone help please - I have a form with tabs on it and on each tab is a sub form
The problem I am having is making the combo box on one sub form requery when data is added on another sub form. It seems to work once when the main form is opened but will not work after that.
I have tried putting the requery command on just about every event I can find but it refuses to update the combo with new data.
If I refer to the 2nd sub form from the 1st I get the error "Cannot find the form"
I hope this makes sense - if not I will try and elborate
Thanks in advance
Peter
 
Old August 5th, 2003, 02:33 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 120
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Peter

I'm working from memory here, so it may not be quite correct...

You cannot directly refer to a subform from a subform. You first have to go back up the tree to the parent form and then back down to the second subform - something like this:

Me.Parent.[Second SubForm COntrol Name].Form.cmbControlToUpdate.Requery

A simpler solution would be to assume that things have changed and requery the second subform whenever the user clicks on its tab.


Brian Skelton
Braxis Computer Services Ltd.
 
Old August 7th, 2003, 02:00 AM
ppenn
Guest
 
Posts: n/a
Default

Thank you Brian
Worked very well
Regards
Peter:):)
Quote:
quote:Originally posted by Braxis
 Peter

I'm working from memory here, so it may not be quite correct...

You cannot directly refer to a subform from a subform. You first have to go back up the tree to the parent form and then back down to the second subform - something like this:

Me.Parent.[Second SubForm COntrol Name].Form.cmbControlToUpdate.Requery

A simpler solution would be to assume that things have changed and requery the second subform whenever the user clicks on its tab.


Brian Skelton
Braxis Computer Services Ltd.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Subform Record Saved, Update/Requery Form controls CB-VTXer Access VBA 2 August 6th, 2007 02:35 PM
Requery a subform aware Access 3 December 27th, 2005 12:25 PM
Requery SubForm lizhaskin Access 1 November 28th, 2005 02:19 PM
Filter Subform B Based on Field in Subform A SerranoG Access VBA 3 June 18th, 2004 12:23 AM
requery subform bpete Access VBA 5 March 30th, 2004 09:31 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.