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

Access 2K Code to build and save query

Status
Not open for further replies.

ledsoft

Programmer
Sep 12, 2001
12
0
0
US
I need help in an Access 2000 db. I need to create queries based upond selection and store the results as a query so the the end user can create report off of it. The problem is that I am not able to find anything about being able to programatically creating and saving the query in Access.

Any help wouild be deeply appreciated.

Bruce
 
The following selects all records from a table name represented by the variable strTable_Name where the field weekending matches a variable called WEDT ....and creates a query representation of those parameters called queryfromvb.


strSQL = "SELECT * FROM [" + StrTable_Name + "] WHERE [weekending]=#" + WEDT + "#;"
Set qdf = dbs.CreateQueryDef("QUERYFROMVB", strSQL)
 
It says "Object Required" error 424. I had been using ADO, but I don't see an option in its area to do this. DAO does though.

Any ideas for ADO on how to define.

Sorry,

Bruce
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top