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

Need help with combo box

Status
Not open for further replies.

nikko1

Programmer
Jan 28, 2005
8
0
0
US
I need help. I want a control to display a combo box with the values from a table based on the value in another control. Explaination... I need to have the categories show only for the account number pertaining to the record I am on. The account number is in both the categories table and the detail table. Please advise.
 
Set the RowSource of the combo to something like this:
SELECT your field list
FROM tblCategories
WHERE fldAccountNumber=[Forms]![form name]![account number]

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I tried it with ...

SELECT [Categorytbl].[Categoryid] AS CategoryID, [Categorytbl].[Category] AS Category
FROM Categoriestbl
WHERE ((([GLNumber])=[Forms]![Ledgerstbl subformDetail]![GLNumber]));

and the drop down field is empty. Any advice?
 
Replace this:
WHERE ((([GLNumber])=[Forms]![Ledgerstbl subformDetail]![GLNumber]));
By something like this:
WHERE GLNumber=[Forms]![name of mainform]![Ledgerstbl subformDetail].Form![GLNumber];

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
It is not empty any more, but the drop down list is the same no matter what value is in the GLNumber field. Help :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top