Recordsets - Opening
I am using the bookBeginning Access 2002 VBA and am stuck on Chapter 6 (page 226 for those who have it) which is opening a recordset. I have typed in the code it tells you to enter and this is a copy of what i have entered:
Public Sub OpeningARecordset()
Dim db As Database
Dim rec As Recordset
Dim intRecords As Integer
Dim message
Set db = CurrentDb()
Set rec = db.OpenRecordset("tblIceCream")
intRecords = rec.RecordCount
MsgBox "There are " & intRecords & " records in the tblIceCream table"
rec.Close
End Sub
(just incase i spelt something wrong)
But it comes up with a Compile Error Expected: =.
It says in the book that you have to make sure your references are correct and they are all in order ( I have: "Visual Basic For Applications", "Microsoft Access 10.0 Object Library", "OLE Automation" and "Microsoft DAO 3.6 Object Library" all check and nothing else. I cant work out what i've done wrong.
Can anyone help?
Matthew Leek
__________________
Thanks,
Matthew
|