I have this code in VBA but its returning an empty recordset...
Sub total_disc()
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("pre_pl")
rst.MoveFirst
Where pre_pl is a table with more than a million records. Despite that I am getting rst = nothing.
Any ideas what am I missing?
Thanks!
MsgBox rst.RecordCountjust after yourrst.MoveFirstand see what you get. Because I copy and pasted your code, replace the name with one of my tables and it worked fine.