|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Hello,
I have a button which will look up values in a particular column in a table which is already set. An example, I have a button which has "Run Query" on it. When the user clicks on "Run Query" they can enter a value and a list of Manufacturers will come up. I now need this button to have a drop down list, so the end user can choose which column in the table they want to so a query on. Therefore, I have 4 columns with the headings of "Manufacturer", "Product Name", "Type of Product", and "Box Number". The user wants to be able to click on the Run Query button, and a box will pop up. Then they want to be able to click a down arrow which will have the headings of the table already in the box. Once they choose the column, like "Type of Product", then they want to be able to type in a word, for example "Software". Once they type in the word they want queried a list will come up everything that has the word "Software" in it. I already have the database setup so the user can type in a word like "Windows", and everything with "Windows" in it will come up in a report. But this button only looks at one column in my table which is "Product Name". Any and all assistance will be greatly appreciated. Dawn |
|
#2
|
|||
|
|||
|
hi again,
I answered (or tried!!) your other post about the same (I think) problem?! having read this one, it seems much easier than I thought.. all you need is a section in your SQL statement telling it to look at the one particular column heading, depending on what the user selects, right? I think all you will need to do is: SQL = SELECT * FROM table_name WHERE column_header = '" & request.form("column_selection") & "';" and the drop down box would just be: <select name="column_selection"> <option value="manufacturer">Manufacturer</option> <option value="product_name">Product Name</option> <option value="product_type">Type of Product</option> <option value="box_number">Box Number</option> </select> So when the SQL statement is called, the request.form("column_selection") will get the value selected.... for example: SQL = "SELECT * FROM table_name WHERE column_header = 'manufacturer';" hope this is ok! |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft SQL Server > How do I create a button on a form that will search the different table headings |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|