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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Advance search tool in a DAP

Status
Not open for further replies.

Techniproshop

Programmer
Apr 24, 2007
50
CA
Ok now that I finally have my drop-down-list sorting my DAP individually, (many thanks to fneily!) I'm now looking to have an Advance Search tool to give a better search possibility to users. So first, I need a button or just a link to open the Advance search page which should be a pop-up window. On that page, user will have the options to choose from many drop-down-list (Category, Cost Range, Funding etc...) and a Text box that will search the fields Title and Details for a specific word or phrase.

I've seen that tool on many sites and programs I used in the past and think this is a must to have when running a database.

Any example I could use to build my advance searching tool?

Thanks.
 
Close to what I'm looking for. First of all, I tried and added that search box on my dap but I got an "unknown" error line 116 (how do I find the right line if I want to fix the error?) Also, If I used that search tool on a separated page (small popup window), how can I tell the system to search on my main page and not on that search window? Here is the code anyway:


'-----------------------------------------------------------------------
'This routine searches all fields in the defaultrecordset for something
'entered by a user in a Search text box. It passes through each field
'the recordset until it finds a match.
'-----------------------------------------------------------------------
dim i 'Counter variable
dim rs 'ADO recordset object
dim fld 'ADO field object
dim FieldCount 'Number of fields in the recordset

FieldCount = MSODSC.DefaultRecordset.Fields.Count

'This will return the default recordset on the page
'in this case, the Customers table.
set rs = MSODSC.DefaultRecordset

for i = 0 to FieldCount - 1
'get a field object
set fld = rs.Fields(i)

'0 = Skip no records
'1 = Search forward
'1 = Start with the first record
rs.Find fld.name & " = '" & txtSearch.value & "'", 0, 1, 1

'Check for EOF. If at EOF but have not exhausted
'all the fields, then reset to the first position in the
'recordset. Otherwise, if a match was found, exit the loop.
if rs.EOF then
rs.MoveFirst
else
exit for
end if
next

'Clean up.
set fld = nothing
set rs = nothing

Now, this is nice to have but it's also incomplete. I need to have a pop up window (how do I set the hyperlink so a new page appears in a different window?) with differents DHTML drop-down and the user will select any of them to find the record(s) he wants. The main page will be filtered depending of what the user will choose in those lists.

"show records where field village = Svillage and/or field category = SCategory and/or field Status = SStatus and/or field TITLE = STitle or any part of text in STitle"

Then user will click on the CmdFind button, this window will close and he will be back to the main page and will see the results of this search.

??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top