iroyal2016
New member
- Local time
- Today, 01:52
- Joined
- Apr 18, 2016
- Messages
- 8
Hi, I'm new in this forum and welcome all
I have a small question :
The immediate window gives me :
1
what is wrong with my code ?
I have 3 records in that query.
I have a small question :
Code:
Public Sub getCount()
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim strSQL As String
strSQL = "SELECT Employees.Company, Employees.[Last Name] FROM Employees;"
Set db = CurrentDb
Set rst = db.OpenRecordset(strSQL)
With rst
Debug.Print .RecordCount
End With
End Sub
The immediate window gives me :
1
what is wrong with my code ?
I have 3 records in that query.