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

Type mismatch error 1

Status
Not open for further replies.

lbigk

MIS
May 24, 2002
58
US
Hello,
I have a form that I am trying to set RecordSource based on a partial date selected from a table. I am using the following code to find records in the table:
Set rst = dbs.OpenRecordset("SELECT tblStrawmanQ.StrawID, tblStrawmanQ.State, “ _
& “tblStrawmanQ.Media, tblStrawmanQ.DropDate, tblStrawmanQ.InHomeDate, “ _
& “tblStrawmanQ.Campaign, tblStrawmanQ.PlanCirculation, tblStrawmanQ.Priority, " _
& "tblStrawmanQ.Notes, (DatePart('m',[tblStrawmanQ].[DropDate]) & '/' & DatePart('yyyy',[tblStrawmanQ].[DropDate])) AS DtPt " _
& "FROM tblStrawmanQ;")
I am using Access 2003, the code worked first time, but now I am getting the following error: Run-time error '13'; Type mismatch

Thank you.
 
Try:

Dim rst As DAO.Recordset

And make sure you have a reference to:

Microsoft DAO x.x Object Library
 
Thank you, I added DAO to Recordset declaration and it worked.
Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top