Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

QueryByForm gives weird results when using Form/Subforms

Status
Not open for further replies.

HLotis

Programmer
Dec 14, 1998
31
US
I need to query with multiple values for each field like State, Region, InterestGroup so I chose QueryByForm for my query filtering.<br>
<br>
But QueryByForm gives weird results when I use a screen with Form/Subforms.<br>
<br>
After entering a value only in the subform(such as State=VA ), I choose ApplyFilter from the Toolbar but the resulting set shows ALL records in the Master Form. <br>
<br>
Do I need another form to display the QBF results? I only want to see the selected records. How can I requery? How do I see the results without having to skip thru the unselected records? <br>
<br>
I am using a command button to use the current query filter for subsets for labels and reports. Must I do the same to see the results after ApplyFilter from the Toolbar?<br>
<br>
Why is the Toolbar a problem?<br>

 
Does the main form's underlying query include the fields you're using as criteria?
 
I have a parent table linked to a child table. I am still working on data entry screens for this. So I looked at Northwind in Samples and changed the searchfilter for each field from DatabaseDefault to All.<br>
<br>
Looking Access97 NorthwindDB and opening CustomerOrders with OrderDetails and Products, you can focus on the main form and right click for QBF and choose a Product. However, ALL the parent records are shown. I would like to see only those parents that contain the selected Product.<br>
<br>
<br>
<br>

 
A quick solution is to build a new query including all the fields you want to see in your main form and subform. Then use the form wizard to create the form for you. Then your filter should work as expected.
 
The Northwind Sample has a CustomerOrders as a main table and relates it to two other tables, Products and OrderDetails. Any field visible on the form can be queried. <br>
<br>
However, querying on SubForms gives weird results when using QueryByForm. ALL parent records are still show up there. I only want to see the subset of the chosen records after I ApplyFilter. <br>
<br>
I was looking for a way to do a Requery or to again present the data, using the newly created QBF filter.
 
Is your subform's name property the same as the subform's source object property? Access doesn't require them to be the same but I find if they are different I wind up referencing the wrong one in my code, and Access doesn't recognize it.
 
Sorry... that last response should have been posted to a different question...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top