S
StarfishJoe
Need help applying SQL statement to Access2000 Query
I have created a form Named SortFilterForm for a client that filteres a table based on user selected criteria. There are up to 6 fields to select criteria, and one for sort order.
The selection criteria are optional. the Sort order is not.
All of this has been concatenated into a single SQL statement ( "Select [Project List].* from [Project list] ...
(WHERE.....AND.....AND....) (optional)
ORDER BY [(Field Name)]
The SQL query name is strSQLBuild. it is built at run time based on the user's selections on the SortFilterForm.
ASSUMING the SQL is correct;
I am not sure where to go next I was assuming I should copy the SQL statement to a QueryDef object. There is an example in Access97 concerning this, but not in Access 2000. Is this "older technology".
I am supposed to be working in Access 2000 now since the client has just upgraded all machines to 2000.
Where should I place this SQL statement so that it:
1.. creates a temporaray query based on a single Table
2.. calls an existing form (Main Form), displays the resulting recordset ( type is dynamic ) in either Form view or Datasheet view or On a report. ( if I can just make the connection, I can code to switch between form, datasheet or report view on my own.)
3.. allows the user the option to save the resulting query rather than going through the SortFilterForm's selection criteria again or to not save it.
???
StarfishJoe
I have created a form Named SortFilterForm for a client that filteres a table based on user selected criteria. There are up to 6 fields to select criteria, and one for sort order.
The selection criteria are optional. the Sort order is not.
All of this has been concatenated into a single SQL statement ( "Select [Project List].* from [Project list] ...
(WHERE.....AND.....AND....) (optional)
ORDER BY [(Field Name)]
The SQL query name is strSQLBuild. it is built at run time based on the user's selections on the SortFilterForm.
ASSUMING the SQL is correct;
I am not sure where to go next I was assuming I should copy the SQL statement to a QueryDef object. There is an example in Access97 concerning this, but not in Access 2000. Is this "older technology".
I am supposed to be working in Access 2000 now since the client has just upgraded all machines to 2000.
Where should I place this SQL statement so that it:
1.. creates a temporaray query based on a single Table
2.. calls an existing form (Main Form), displays the resulting recordset ( type is dynamic ) in either Form view or Datasheet view or On a report. ( if I can just make the connection, I can code to switch between form, datasheet or report view on my own.)
3.. allows the user the option to save the resulting query rather than going through the SortFilterForm's selection criteria again or to not save it.
???
StarfishJoe