I am using this Subroutine in a test database and everything works fine.
Sub ShowCount()
Dim myR As Recordset
Set myR = CurrentDb.OpenRecordset("Products")
MsgBox "Number of products is: " & myR.RecordCount & "."
myR.Close
Set myR = Nothing
End Sub
But, if I use it in my active database if get a compile error "User-defined type not defined". When I re-wrtie Dim myR As Recordset and get to the R in Recordset there is no such type (Recordset) listed the drop-down list.i
I designed the Db with relationships, queries, macros, etc. but this is the first time I tried to incorporate a subroutine.
Jeff