DAO Recordset problem

polina

Registered User.
Local time
Today, 03:44
Joined
Aug 21, 2002
Messages
100
Hi,

I have this really strange problem that has never happened before.

I open the DAO recordset:
Set rstCalls = CurrentDb.OpenRecordset("Select * From Calls Where SerialNumber = '500'")

I know for sure that the recordset should return 6 records and it always returns just 1

If I change the sql to "Select Count(*) as Cnt from Calls where SerialNumber = '500'" then the value of Cnt returned is equal to 6.


Can anyone suggest any possible reasons of why the recordset only returns 1 record in the first case

Thanks.
 
I don't know the answer but should you have apostrophes round the number 500, is serial number truly a number by field definition, if so the apostrophes aren't required.
 
Don't know how familiar you are w/ DAO.Recordset, but when you set the recordset it's set to the first record in the recordset. You may need to use rs.MoveLast method to populate the recordset to use Count. Now were you to set a subform to the same recordset, then all 6 should be displayed.
 

Users who are viewing this thread

Back
Top Bottom