Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Record Counting Trouble

Status
Not open for further replies.

sgfromny

Technical User
Jan 17, 2003
120
US
I have 5 records that match this criteria, yet recordcount always reports 1....
Anyone?? Thanks in advance

Code:

Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim sql As String
Dim RecordCount As Integer
EndDate = Now()


sql = "SELECT * FROM tblShopRawTime WHERE [current] = " & True
Set db = CurrentDb
Set rs = db.OpenRecordset(sql)


With rs

RecordCount = rs.RecordCount
 
To retrieve an accurate recordcount from a DAO recordset, you'll need to fully populate it - for instance using a .movelast first (and hint - don't name variables the same as properties (recordcount)).

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top