object variable ......Not set error
I don know whats going on.. I kinda figured i cannot do this..
but it looks alright..
What am i doing wrong?
VB Code:
Private dbsBlastRoom As Database
Private rstDustCollector As Recordset 'DustCollector
Private rstFan As Recordset 'DCFans
Private rstHp As Recordset 'DCMotor
Private Function CalcPurchParts(dec As tDustCollector)
'ALREADY SET dB VAR
CalcPurchParts = Recordset("DCFans", rstFan, mDustCollector.Description.m_FanSize)(2) + _
Recordset("DCMotor", rstHp, mDustCollector.Description.m_FanHp)(2) 'ERROR ON THIS LINE
End Function
Private Function Recordset(Table As String, rstVariable As Recordset, itemSeek As Long) As Recordset
Set rstVariable = dbsBlastRoom.OpenRecordset(Table)
rstVariable.MoveFirst
rstVariable.Index = "PrimaryKey"
rstVariable.Seek "=", itemSeek
rstVariable.Close
End Function
Thanks
Seahag
====================