You are here:

Using MS Access/Navigation Form - Requery Subform

Advertisement


Question
NavigationForm
NavigationForm  
Scottgem,

Thank you for your previous help on my bowling database.

Previously, I had chatted with you about having a tab control on a form with tabs for my 14 teams.  I knew I would have 14 forms become subforms in the tab control on a form, but I did not want 14 queries.

However, I decided to have one form in which I would requery each time I wanted to look at a new teamís recap.  I built my form (RecapSheet), I put it on a tab control in my form (ScoreEntry) along with other forms making up other tabs.

The tab for my (RecapSheet) form is called( Recaps) and it has an option group on it (TeamList) made up of buttons for each team and when one is clicked, the After Update Event for (TeamList) runs, which requeries the query (Recap).

My code on the After Update Event on (TeamList) is:
  Me![RecapSheet].Requery

My criteria in the query (Recap) is:
  [Forms].[ScoreEntry].[TeamList]

It all works fine.

Then I put my form (ScoreEntry) on the newly  built navigation form and it no longer works.

I have spent hours googling the correct syntax to use on a subform of a navigation form but nothing works.

Iím so lost in main form, subform, subform2, navigationsubform that I don't know if Iím coming or going.

I was hoping to use the navigation form in place of a switchboard menu.  I like the look and feel of the navigation form better.

Thank you!  Robecca

Answer
Referencing a subform especially nested subforms can be an exercise in futility. You need to remember that the Nav form is just another control and has to be referenced in sequence with other controls.

So you start with the Forms collection and the name of the main form:

Forms!formname

then you build on it by naming the subform controlname:

Forms!formname!subformname

The next step if to identify the collection the control is part of:

Forms!formname!subformname.Form

Finally, you add the property you want to reference. If you are dealing with a nested subform, you need to start the process, by naming the control and then collection.

You can try using the Expression builder to build the string of references.

Hope this helps,
Scott<>
Blog: http://scottgem.wordpress.com
Website: http://www.diamondassoc.com
Microsoft Access MVP 2007
Author: Microsoft Office Access 2007 VBA

Using MS Access

All Answers


Answers by Expert:


Ask Experts

Volunteer


Scottgem

Expertise

I can answer almost all types of questions relating to Microsoft Access usage and application design. My strengths are database and interface design.

Experience

I've been designing databases for over 25 years working with dBase, FoxPro, Approach and Access.

Organizations
Author of Microsoft Office Access 2007 VBA
Techncial Editor for Special Edition Using Microsoft Access 2007 and Access 2007 Forms, Reports & Queries From Que Publishing

Education/Credentials
Brooklyn College BA

©2016 About.com. All rights reserved.