Access Search Page

tjewers

Registered User.
Local time
Today, 20:06
Joined
Sep 19, 2000
Messages
11
Hi,

I have to create a search page for a large database, where the users can select the criteria they want to search for. I am basically at a loss as to how to start. I know I have to populate a where statement, where the criteria are not null, but I have no other ideas.

Does anyone have any ideas as to how to start?

Thanks, Tracy
 
Hi,

There are a couple of ways you could start out.

If you put combo or text boxes on a form for
each selection criteria you can reference
the combo boxes in query criteria.

A trick here is to wrap each criteria
in your own convertnull() function where a null value is swapped for a "*".

Alternatively you can build up a query in code, if a selection box is not null, add
the contents to a where clause then run
the final built query.

A trick here is to run through if-then clauses to check each criteria with
sql = sql & "[field] = " & [combo box]
& " and " for each clause.

Trim the " and " off at the end with
left(sql,len(sql -5))

hope this helps

bob

[This message has been edited by bob makepeace (edited 10-04-2000).]
 

Users who are viewing this thread

Back
Top Bottom