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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filtering records displayed on subform via combobox

Status
Not open for further replies.

octotech

Technical User
Jun 22, 2001
5
US
Kind of a very specific question- not very familiar with the relationship between forms and subforms. Here goes...

I have a form defined for inputing records. One of the comboboxes is for ease of "Name" entry. Then I have a subform designed as a history and another combobox in the subform defined with the purpose of filtering the records displayed based on "Name" selected. However the issue I'm having is that I can only get it to work where either both comboboxes in the form and subform will synchronize therefore either changing the "Name" for the record being entered in the form or changing the records displayed, or the records in the subform will not filter via the subform combobox.

Hope that made sense- insight greatly appreciated!
 
Hi.
If I understand your question...Usually the form/subform is used when you have a one to many relationship between two tables. If you want to see records based on the "Name" selected in the form, the sub form is designed to display records from another (details) table, records that are identified with the "Name" in the tblName.

Create a relationship between the table "tblNames" and "tblNamesDetails". The relating field in both tables is "Names"

Base the form on the table (or a query): "tblNames" ("Names" is the unique key.)

Base the subform on the table (or query): "tblNamesDetails" (has a field "Names")

Simply, "Names" should be a unique key that attracts records in the subform that can identify with it. The classic reference is to the Orders / OrderDetails tables and their form/sub form in the Northwind sample database that comes with Access.
Use the form wizard to create a new form, use the two tables for selecting fields, and watch what the wizard creates.
If you're trying to create a form and sub form based on the same table, I'm not able to help...wouldn't know how it's done.
Good luck.
:)
Gus Brunston
An old PICKer
padregus@home.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top