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!

Filling Combo Box with specific data highlighted

Status
Not open for further replies.

MichHart

Programmer
Dec 14, 2002
56
CA
Ok, I have a complex situation here. I have a database that has 50 tables in it. The tables are all joined by an index field.

So I have the Name table with a field in it called Address. I have a table called Addresses with a field called Street.

I am using SQL to write the queries with no data controls.

The data in the Address field is connected to the Street field in the Addresses table. The data that appears in the Address field is the Index numberof the Street field, not the actual data.

How do I get the actual data to appear in a control on the form instead of the Index number.

I hope that made sense.

MichHart " Never regret yesterday because it cannot be changed;
Instead make sure today does not become a regret of tomorrow."
 

Are you trying to say something like this
[tt]
SELECT TextDescriptionField, FROM Table1 WHERE IDField = ?
[/tt]
or
[tt]
SELECT TextDescriptionField, FROM Table1
'open connection/recordsource,recordset
Do While Not RecordsetObject.Eof
Combo1.AddItem RecordsetObject.Field("TextDescriptionField")
RecordsetObject.MoveNext
Loop
'close object as necessary
[/tt]

If I or anybody else did not get it then try again

Good Luck

 
ok yes that fills the combo box. I have done that before.

But what I want to happen is the value in the Street field to appear first and then the rest of the list.

??

Mich Hart " Never regret yesterday because it cannot be changed;
Instead make sure today does not become a regret of tomorrow."
 
If I understand your database you have something like:

Table Name with some fields say:
x - the Primary Key
y - some other data
z - some more data
:
:
Address - the Foriegn Key to the Addresses Table

and
Table Addresses with some fields say:
ax - the primary key
ay - some other data
az - some more data
:
:
Street the Street name.

The query

select name.x, name.y, addresses.ax, addresses.Street
from Name, Addresses
where name.address = addresses.ax

would give you any information from either table.

Note it isn't necessary to select anything but the addresses.street field if that's all yo want.
 
Thanks I will see if I can apply my fields to those of the example.

I have managed to list all the items in the combo box, but what I need to happen now is when a Name is clicked on from a list, the selection that corresponds to one in the combo box list will appear in the combo box.....

Does that make any sense?

Thanks for any help, this has me baffled!!

MichHart " Never regret yesterday because it cannot be changed;
Instead make sure today does not become a regret of tomorrow."
 
I know this is probably available in the search, but with the search option still out of order, I am perlexed as to how to do this.

Can anyone help please??

I have several combo boxes that I need this to happen with.

I have the entire list now appearing in each of the combo boxes, but what I need to happen is when a record is selected the selection for that field will appear in the combo box

Does that make anymore sense?

Desperately looking for an answer

MichHart " Never regret yesterday because it cannot be changed;
Instead make sure today does not become a regret of tomorrow."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top