Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
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  
Old July 12th, 2002, 01:36 PM
dawnh44 dawnh44 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Posts: 8 dawnh44 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question How do I create a button on a form that will search the different table headings

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

Reply With Quote
  #2  
Old July 12th, 2002, 06:12 PM
fakker fakker is offline
The calm b4 the storm
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Manchester, UK
Posts: 404 fakker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via Yahoo to fakker
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!
__________________
Matt 'Fakker' Facer

mattfacer.com

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft SQL Server > How do I create a button on a form that will search the different table headings


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway