This is assuming you already have a reference to DAO selected. If not, in a
code window, select Tools | References. Make sure you have selected
"Microsoft DAO 3.5 Object Library". The actual version may vary on your
system.
HTH
Mike Krous
"deko" <dj****@hotmail.com> wrote in message
news:Z9*******************@newssvr29.news.prodigy. com...
You might try:
Public Function getdata()
Dim rstSource As DAO.Recordset
Set db = CurrentDb
Set rstSource = db.OpenRecordset("tblSource")
End Function
"Manning" <ma*****@NOSPAMbartlett.net> wrote in message
news:bq**********@lust.ihug.co.nz... Hi
Could someone tell me what is wrong here? I'm using Access 2000 and a class module. The table is called "tblSource"
For some reason the following code generates a "Run-time error 13: type
mismatch" error and I just can't see why.
Public Function getdata()
Dim rstSource As Recordset
Set rstSource = CurrentDb.OpenRecordset("tblSource")
End Function
It can't be that hard, yet I keep getting errors. Can someone tell me
what I am doing wrong?
The table tblSource has only 2 columns, an autonumber key field and a
double numeric.
Manning