M
max
I am trying to write my first VBA app to populate a table
from a subset of another table. However, I keep getting a
"Run-time error '13': Type Mismatch" on the "Set
rstWeeks...." line below. (Marked with a "--->")
This is all the code that is written so far. The
db.openrecordset seems to be working...b/c if I remove the
"set rstweeks =", code runs fine. From looking at other
samples...it seems that this is pretty
straightforward...but am I missing something here? If
rstWeeks is a recordset and db.openrecordset returns a
recordset, then what is the problem?
Any help?
Public Sub cmdRunIteration_Click()
Dim db As Database
Set db = CurrentDb
Dim rstWeeks As Recordset
--->Set rstWeeks = db.OpenRecordset("Select Ending, SP,
YieldSP, Yield3mo, Yield10yr FROM Weeks WHERE Ending >
1/1/2003")
End Sub
from a subset of another table. However, I keep getting a
"Run-time error '13': Type Mismatch" on the "Set
rstWeeks...." line below. (Marked with a "--->")
This is all the code that is written so far. The
db.openrecordset seems to be working...b/c if I remove the
"set rstweeks =", code runs fine. From looking at other
samples...it seems that this is pretty
straightforward...but am I missing something here? If
rstWeeks is a recordset and db.openrecordset returns a
recordset, then what is the problem?
Any help?
Public Sub cmdRunIteration_Click()
Dim db As Database
Set db = CurrentDb
Dim rstWeeks As Recordset
--->Set rstWeeks = db.OpenRecordset("Select Ending, SP,
YieldSP, Yield3mo, Yield10yr FROM Weeks WHERE Ending >
1/1/2003")
End Sub