DAO rs empty - same SQL has results

bigal.nz

Registered User.
Local time
Today, 18:35
Joined
Jul 10, 2016
Messages
92
Hi Guys,

I am stuck on this one.

If I try the SQL:

Code:
SELECT * FROM MAS

I get the expeced 1500 odd records.

If I try:

Code:
Dim rs As DAO.RecordSet
Dim db As DAO.Database
Dim strSQL As String

strSQL = "SELECT * FROM MAS"
Set db = CurrentDb

Set rs = db.OpenRecordset(strSQL)
debug.print(rs.RecordCount)

prints to console 1 (which is empty anyway).

I am not sure how to debug from here.

Tables are split if thats relevant.
 
The record count on a recordset sometimes needs "priming" by doing this:

Code:
rs.MoveLast
rs.MoveFirst

THEN try your debug.print command.
 
It looks okay to me. Have you disabled the errors?
 

Users who are viewing this thread

Back
Top Bottom