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
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