Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Record Count Issue

Status
Not open for further replies.

scottru

Programmer
Jan 9, 2003
2
US
Hello,

Here is the code I am trying to get to work.

Function Mas90RecordCount()

Dim MyDB As Database
Dim MyRS As Recordset
Set MyDB = CurrentDb()
Set MyRS = MyDB.OpenRecordset("SO_03SOHistoryHeader", dbOpenDynaset)
MyRS.MoveLast
Mas90RecordCount = MyRS.RecordCount
MyRS.Close

End Function

When I run this routine, I get a error # 13 on line
Set MyRS = MyDB.OpenRecordset("SO_03SOHistoryHeader", dbOpenDynaset)

What do I need to accomplish to correct this error.

Thanks,
Scott




 
If you are using Access 2000, then MyRS will probably refer to an ADO Recordset. MyDB.OpenRecordset will return a DAO recordset. What you need to do is declare your recordset to be a DAO Recordset - i.e.

Dim MyRS As DAO.Recordset

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top