How do i point to a combobox using SQL? (using rowsource)

homer2002

Registered User.
Local time
Today, 10:22
Joined
Aug 27, 2002
Messages
152
Hi does anyone know how to point to a combo box correctly in SQL

i have a few tables and a for with one BIG list in a combo box.

to save having to keep scrolling down the list i created an unbound combo box, to give the user the ability to kinda lock the other one (which is used for adding records)


put simply 1 combo box should determine which the other one lists

so If I were to select somthing in the unbound one the one thats bound will only show the others selected item.
_____________________________________________-

i used SQL in the row Source like this

SELECT DISTINCTROW [Team].[TeamId], [Team].[NameOfTeam] FROM [Team] WHERE [team].[TeamID] = [Combo_TeamFilter].[value] ORDER BY nameofteam

this just makes my bound combo box empty


_______________________________________________


TeamFilter is the unbound combo box
I want to use the first column in the combo box for the rowsource. The data type of this field is ReplicationID.

any ideas? am i just doing somthing stupid???
 
I understand that your Combo_TeamFilter is not bound, but you will need to ensure that the rowsource of this combo captures your ReplicationID also.

ie: Check that you are not capturing the team name etc instead of the ID

I am no SQL expert, but I regularly do the same thing that you are attempting, and use the format for the WHERE statement as:

(Table.FieldID)=[forms]![formname].[comboname]

Post the rowsource SQL for both combo's, and list their bound columns, and I may be of more assistance (or not :confused: )

Brad.
 
You need to tell the SQL where the combo is
ie
SELECT DISTINCTROW [Team].[TeamId], [Team].[NameOfTeam] FROM [Team] WHERE [team].[TeamID] = Forms!NameOfForm!Combo_TeamFilter ORDER BY nameofteam

If you have a huge list, why not use a combination of a textbox and listbox to select your values? I have an example if you are interested
 

Users who are viewing this thread

Back
Top Bottom