Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Two combo box search on one table!

Status
Not open for further replies.

chassid

MIS
Aug 27, 2000
58
0
0
US
To all,

I have been working with an extremely long database and would like to do a specific search which I haven't been able to figure out. It would be better if the user was able to search this database with two combo boxes. On the first one the user would select what field he is interested in searching. The second box would automatically load pre-assigned values that are common to a number of fields. (In Netscape there would have to be a submit button since this automated response doesn't seem to work with netscape) After selecting the subfield on the second box and clicking the search button all of those records which are common to the first and the second box would then list.

I have figured out how to design two combo boxes which automatically updates, but I do not know how to make them read only one table. All literature on this shows a different boxes for each table available. Does anyone know how to do this with one table!

I greatly appreciate everyone's help!

Daniel
 
temp1=request("combo1")
temp2=request("combo2")

strsql="select * from phone where fname='" & temp1 & "'"
strsql=strsql & " and "
strsql=strsql & "lname='" & temp2 &"'"

conn.execute(strsql)

Maybe I don't understand your question?
 
Thanks jhembree,

I kind of understand your post. You would have two combo requests to one table. My question is where do I assign all of the field names and the variables found in them.

An example of this is that in the field chapter, there are 23 members and 14 guests. The user would click on the first combo box and select the field chapter. The second combo box would automatically update with the entries members and guests. Once you would choose members the 23 names, addresses, and all other fields would appear. How would that be coded?

Thanks for the help,
Daniel
 
I don't understand your question. Can you populate combo1 with the field chapters? When the user selects the chapter, does combo2 get filled, while maintaining the value in combo1? If both combo1 and combo2 are populated correctly and both combos contain the properly selected values, then you either click a submit button to run the page again which will queery the database and display the info or you can create a client-side script that will redirect the page again to display the info. After both combos are filled and values selected, you must submit the page again to read the values and query the database.
 
Jhembree,

I am sorry I have not correctly expressed what my question was. I do not know how to code so that the second combo box will read the fields in the table rather then look for a second table. You see, the literature I have shows how to make two combo boxes search two different tables, but I only have one HUGE table. The first combo box should search the field at the top of the table and the second should search the values underneath this first field on the same table! Do you know how to code this? If yes, please give me a description.

Thank you for the help,
Daniel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top