Solved

excel macro select from combo/select box

Posted on 2013-10-28
7
152 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 46

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
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.

808 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