Solved

excel macro select from combo/select box

Posted on 2013-10-28
7
134 Views
Last Modified: 2014-10-22
Folks

I am looking for advice to select values from a combo box

essentially my macro connects to oracle db and queries a table and allows the user to specify the where claue input field i.e like so

 strSQL = "Select projectnum,description from projects where " & InputBox(Prompt:="Your where clause.", _

essentially my where clause statements are contained in another table called queries

here the colomn queries.whereclause contains the actual where clause

how do i create a combo or select box to select the where clause automatically?

any ideas would be great

essentially it should do the following in psueadocode

 strSQL = "Select projectnum,description from projects where " & (select queries.whereclause value)

thanks in advance!
0
Comment
Question by:rutgermons
7 Comments
 
LVL 6

Expert Comment

by:ButlerTechnology
ID: 39605258
I have attached a workbook with a combo-box example.  Columns A and B are used to generate the entries for the list box.  I use the A column as an index as the combo-box returns the entry being selected -- not the value.  Cell D1 is used to hold the value that is selected and F2 is using a vlookup to display the selection.  There is a macro that is attached to the combo-box that executes when selecting an item.  It will use the message box that displays the selection using F2.
Combo-Box Properties
Tom
Combo-Box-Example.xlsm
0
 

Author Comment

by:rutgermons
ID: 39618035
Tom

how can i get this to read from Oracle then?
0
 
LVL 29

Expert Comment

by:gowflow
ID: 39823769
I see this question is long time outstanding, do you still need help on this one too ?
gowflow
0
 

Accepted Solution

by:
rutgermons earned 0 total points
ID: 39824541
i actually got it to work myself so no worries!
0
 
LVL 45

Expert Comment

by:Martin Liss
ID: 40396428
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now