Ok, but it still does not answer the question on how to read and import from a SQL table into a Combobox.
Main Topics
Browse All TopicsHi,
I have a form with a browse feature and a combobox.
I need users to first select the file they want to import. Second, select a group that is defined in the SQL DB.
Both of these MUST be selected before continuing to display a chart.
Based on the combobox selection, will determine which group will be displayed in my Excel sheet. In my example I used segment="IT", but there are numerious groups defined in the DB.
i tried numerious code, but could not get it to work.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
i changed the code to add a double quote on the Where Segment line, since it needed to be closed.
.Open("SELECT [Project Name],MIN([TASK Name]),JOBFunction" & _
" from Data" & _
" Where segment = ' " & cmbBox1.SelectedValue & " ' " & _
" GROUP BY [Project name],[TASK Name],JobFunction" & _
" ORDER BY JOBFunction")
However, i receive an error
I used the following code and it works. See any issues doing it like below?
strUsersConnSQL = "SELECT [Project Name], MIN([TASK Name]), JOBFunction from Data " & _
" Where segment ='" & cmbBox1.SelectedValue & "'" & _
" GROUP BY [Project name],[TASK Name],JobFunction ORDER BY JOBFunction"
.Open(strUsersConnSQL)
First, it was " Where segment = '" & cmbBox1.SelectedValue & "' & _
That did not work, we did: Where segment = '" & CType(cmbBox1.SelectedValu
That also did not work, we tried that command in one line.
The first attempt was almost correct, but it was missing a quote. Took my a full day to figure it out.
If you check my comment 25178461, the single quote was NOT missing.
You asked many questions in this one question and one of them was answered in 25177046.
I spent my time and effort trying to solve YOUR problem and all i wanted in return was appreciation but some people tend to be EXAMINERS(marking student's papers) in that respect as well.
Business Accounts
Answer for Membership
by: CodeCruiserPosted on 2009-08-25 at 01:11:08ID: 25175359
We use ADO.NET in VB.NET not ADODB.