two database columns to one combo box

  • Thread starter Thread starter dh
  • Start date Start date
D

dh

I have a connect string for loading a combo box that I want to modify. Now
it ends up being one column from my access database, feeds a combo box on a
Custom Outlook form.
Connect string:
strSQL = "SELECT [DienCodes],[DetailedApplication]" & " " & "AS FinalCodes"
& " " & "from Codes " & "WHERE [CodeID] =" & CatID & " " & "AND" & " " &
"[CountryCode] =" & CountryCode & " " & "ORDER BY [DienCodes];"

My two columns from the database are DienCodes and DetailedApplication



I want to take two columns and concatenate them into the one combo box.
I am having trouble figuring this out.
Any assistance would be appreciated!
Thanks
DH
 
My two columns from the database are DienCodes and DetailedApplication
I want to take two columns and concatenate them into the one combo box.
I am having trouble figuring this out.

You're concatenating a lot of little pieces that could be concatenated
as big chunks!

Try

strSQL = "SELECT [DienCodes] & [DetailedApplication] AS FinalCodes" _
& " from Codes WHERE [CodeID] =" & CatID & " AND [CountryCode] =" _
& CountryCode & " ORDER BY [DienCodes];"

The purpose of concatenating is just to get a valid SQL string - you
don't need to treat each word and blank as a separate substring.
 
Thanks I will give it a try!
DH

John Vinson said:
My two columns from the database are DienCodes and DetailedApplication
I want to take two columns and concatenate them into the one combo box.
I am having trouble figuring this out.

You're concatenating a lot of little pieces that could be concatenated
as big chunks!

Try

strSQL = "SELECT [DienCodes] & [DetailedApplication] AS FinalCodes" _
& " from Codes WHERE [CodeID] =" & CatID & " AND [CountryCode] =" _
& CountryCode & " ORDER BY [DienCodes];"

The purpose of concatenating is just to get a valid SQL string - you
don't need to treat each word and blank as a separate substring.
 
Back
Top