Display Columns of Row in ComboBox (1 Viewer)

Ksabai

Registered User.
Local time
Today, 01:24
Joined
Jul 31, 2017
Messages
104
Hi,

I have a table as below:

ID City1 City2 City3 City4 City5 City6
Michigan aa bb cc dd ee ff

i have a combox cboState to select the State Michigan
In combobox cbocity i need itemdata as aa;bb;cc;dd;ee;ff

Iam sure there should be way other than an union query.

Request anyone to Help.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 04:24
Joined
May 21, 2018
Messages
8,529
You really should fix that table structure, but..

Code:
SELECT 
 ID,
 City1 as City
FROM 
 YourTableName
UNION
SELECT 
 ID,
 City2 as City
FROM 
 YourTableName
UNION
SELECT 
 ID,
 City3 as City
FROM 
 YourTableName
UNION
SELECT 
 ID,
 City4 as City
FROM 
 YourTableName
UNION
SELECT 
 ID,
 City5 as City
FROM 
 YourTableName
UNION
SELECT 
 ID,
 City6 as City
FROM 
  YourTableName
 

June7

AWF VIP
Local time
Today, 00:24
Joined
Mar 9, 2014
Messages
5,472
Alternative is combobox RowSourceType set for ValueList and VBA builds the list and sets RowSource.
 

Users who are viewing this thread

Top Bottom