Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access 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 15th, 2005, 02:31 PM
Authorized User
 
Join Date: Jun 2003
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default Requery a subform

Hi All, me again

I now have my form set up with a main form and 2 subforms. 1 showing roles and the other showing courses based on the role.

What I can't figure out is how to add a role in 1 subform and have the second subform requery and show the courses.

All data is normalised into correct tables.

The only way I can get it to work is to move off the record and then back again, so guess the underlying tables and queries are OK.

Andy
 
Old August 15th, 2005, 03:32 PM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Andy,
In the after update event of the role field put:
Me.refresh
Forms!mainform.Secondsubform.form.requery

Should work.

Kevin

dartcoach
 
Old August 15th, 2005, 03:43 PM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Andy,

You should also put:

Forms!Mainform.SecondSubform.form.requery

In the on current for the first subform. This insures that when you click on a role that's already there, the second subform will refresh with the correct data.

Kevin

dartcoach
 
Old December 27th, 2005, 12:25 PM
Registered User
 
Join Date: Apr 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Kevin,

I am also having a problem requerying a subform.

I patterned the requery after the code you suggested, but I am

getting an error message.

If you have time to look at my problem, I would greatly appreciate it..

thx, Sandra





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 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
SubForm Requery ppenn Access VBA 2 August 7th, 2003 02:00 AM





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