Solved

excel macro select from combo/select box

Posted on 2013-10-28
7
167 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 47

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

726 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