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

Recordset debugging

Status
Not open for further replies.

mirirom

Programmer
Jul 21, 2001
110
US
hi folks,

hopefully one of you can point me in a direction towards fixing this. i've recently been testing some sample code from the MS Solutions9.mdb, and for some reason i keep getting a type mismatch error in the following code (line is labeled). any advice would be greatly appreciated.

mirirom

Private Sub Report_Open(Cancel As Integer)

' Create underlying recordset for report by using creiteria entered in
' MonthlyProjectionsReport Form

Dim intX As Integer
Dim qdf As QueryDef

' Set database variable to current database
Set dbsReport = CurrentDb

' Open QueryDefs Object
Set qdf = dbsReport.QueryDefs("CopyOfChooseDates")

' Set parameters for query based on values entered
' in MonthlyProjectionsReport form
qdf.Parameters("Forms!MonthlyProjectionsReport!BeginningDate") _
= Forms!MonthlyProjectionsReport!BeginningDate
qdf.Parameters("Forms!MonthlyProjectionsReport!EndingDate") _
= Forms!MonthlyProjectionsReport!EndingDate

**** Type Mismatch Error in this line ***********

' Open Recordset object
Set rstReport = qdf.OpenRecordset()
*************************************************

' Set a variable to hold number of columns in crosstab query
intColumnCount = rstReport.Fields.Count

End Sub
 
a few notes:
()both dbsReport and rstReport have been predefined as constants in the General section of the report module.

()i've check to make sure that all the correct libraries have been added in the references. both ADODB & DAO are included

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top