thoms314159
Technical User
I can't figure out what's the matter with this piece of VBA code. Please help.
Option Compare Database
Option Explicit
Private dbCurrent As Database
Private qdfInputInf As QueryDef
Private rsTemp As Recordset
Function InflationCalculator(YearWanted As Integer, YearEntered As Integer) As Double
Set dbCurrent = CurrentDb
Set qdfInputInf = dbCurrent.QueryDefs("qryInputInf"
Set rsTemp = qdfInputInf.OpenRecordset()
....
End Function
This piece of code compiles fine, but when I step through the code in the debugger, I get a "Run-time error '13': Type mismatch" on the line "Set rsTemp = qdfInputInf.OpenRecordset()". Please note that everything up to that line is fine; all variables contain the data that they should, but rsTemp contains no data. Oh yeah, and I did explicitly select the reference to the DAO 3.6 Object Library.
Please help!
Thanks in advance.
Option Compare Database
Option Explicit
Private dbCurrent As Database
Private qdfInputInf As QueryDef
Private rsTemp As Recordset
Function InflationCalculator(YearWanted As Integer, YearEntered As Integer) As Double
Set dbCurrent = CurrentDb
Set qdfInputInf = dbCurrent.QueryDefs("qryInputInf"
Set rsTemp = qdfInputInf.OpenRecordset()
....
End Function
This piece of code compiles fine, but when I step through the code in the debugger, I get a "Run-time error '13': Type mismatch" on the line "Set rsTemp = qdfInputInf.OpenRecordset()". Please note that everything up to that line is fine; all variables contain the data that they should, but rsTemp contains no data. Oh yeah, and I did explicitly select the reference to the DAO 3.6 Object Library.
Please help!
Thanks in advance.