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

Combo only shows one record

Status
Not open for further replies.

Steven811

Technical User
Apr 15, 2004
76
GB
Hi

I've created 2 cascading combo boxes and they work okay with the exception that child only shows the first record.

The select query I'm using is as follows:

(I'm not sure if it's this)

[SELECT [qryAllCust].[CustKey], [qryAllCust].[CompanyName] FROM qryAllCust WHERE ((([qryAllCust].[CustKey])=[Forms]![forCascTest]![cboRep])) ORDER BY [qryAllCust].[CompanyName];]

Brains even more dead than ever today and I can't work it out.

Thx

Steven811
 
Without knowing the detail of what is in the queries and tables you are referring to in the SQL - it looks as though you may be specifying a single company by the selection criteria you are using.
The entry in cboRep may have a single instance in [qryAllCust].[CustKey]
Try it against the full table....

Frank J Hill
FHS Services Ltd.
frank@fhsservices.co.uk
 
Hi Frank

The query returns all of the records.

The combo returns a single record regardless of the parent combo selection. I'm sure it's something simple, I just don't know what it is.

Steven811
 
Check to see if you have list rows set to 1 - this is the number of rows that are visible when the ocombo is opened.

Frank J Hill
FHS Services Ltd.
frank@fhsservices.co.uk
 
You say you're using 2 combo boxes. Is the query you provided for the 1st or 2nd box? What is the query for the other box?

Randy
 
This is the select query foe other combo

[SELECT [tblAccountManager].[RepKey], [tblAccountManager].[Rep] FROM tblAccountManager ORDER BY [tblAccountManager].[Rep];]
 
How are ya Steven811 . . . . .

Specify what you expect to get in the [blue]Child[/blue], when you make a selection in the [blue]Parent![/blue]

Calvin.gif
See Ya! . . . . . .
 
The second combo should show all of the customer records for the selected rep field of the first combo box.

 
Are you using something like this: (for the second combo)

SELECT * FROM tblAccountManager WHERE Rep=" & Me.cboRep

It is possible that:
a) You are picking up the wrong reference from the bound field of the combo.
b) the table you are working with tblAccountManager is not structured with a common field that is selectable
c) Is the Rep field and ID or a full name and does the equivalent exist in the table.

Frank J Hill
FHS Services Ltd.
frank@fhsservices.co.uk
 
OK Steven811 . . . .

From your initial post the SQL shows your using an embedded query, and we don't know what this is. We also don't know your table structure so its hard to tell.

An easy method you can try is this:

Open the form and [blue]make a selection in the Parent Combo.[/blue]
Minimize the form.
Then make a query to return the records you want.
[blue]Copy/paste the SQL[/blue] from the query to the RowSource of the Child Combo.

Or you can post the SQL of the embedded query ad we'll see what we can do . . . .



Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top