Type Mismatch in Recordset sql

  • Thread starter Thread starter Carrie L.
  • Start date Start date
C

Carrie L.

Frustrated! What have I done wrong, when I try to run the following code, it
gets to the set rst line and gives me a type mismatch...

Sub runstuff()
Dim dbs As Database
Dim rst As Recordset
Dim strsql As String
Dim dept, mgrid As String
Dim ckpopu1 As Integer
Dim firstd As Date
Set dbs = CurrentDb
strsql = "Select [Current Departments].* from [Current Departments]"
Set rst = dbs.OpenRecordset(strsql)
 
Carrie

You don't mention which version of Access. At one point, Microsoft changed
the default model from DAO to (?hmm?) ADO.

See what happens if you change your DIM statements to something like:

Dim dbs As DAO.Database
Dim rst As DAO.Recordset

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
Back
Top