Question : Build SQL statement from a form

I want to build a form for a user to build a query.  There are several fields: start date, employee, client, user, and problem.

I would like the user to be able to check which parameters he/she wants to use in the query and then execute it.  Example, check date and employee - the query will only search the table for the employee between the dates entered.

Then for the problem, (if checked) I would like to put in a boolean search.  ie. "Like software and install".

I already have the form created, just need to know how to write the code to create the needed SQL statement.  Thanks, Doug

Answer : Build SQL statement from a form

There's a sample database that shows how to construct a search form that uses multiple criteria fields--

ftp://216.122.12.123/pub/candace/candace/multcrit/multcrit.zip

and there is a free question where others have given their advice at this link

http://www.experts-exchange.com/jsp/qShow.jsp?ta=msaccess&qid=11032162

You might find their coding logic enlightening/preferable.

I notice that Simon has added the "Select and where" text at the end after the string is built.

Random Solutions  
 
programming4us programming4us