This is probably one of the most simple things to do in VB, yet somehow
I've messed it up and cannot get it to work properly. I've used it
dozens of times in the past, but for whatever reason I cannot get it to
work today. I've studied both my old and new code and cannot see a
reason why it's doing what it is. I've been hammering my head against
the wall for three hours now playing around with ever simplified
versions of the code to try and get it to work, but no dice.
The problem?
The recordcount property returns a value of "1" no matter what. It
doesn't matter if there are 3 records or 30,000, the recordcount
property returns a value of 1. The recordset does accurately show what
the first recordset contains, but never shows the other records.
The setup?
I tried moving my code around trying to isolate the problem before I
finally broke down and created a new sample database to insure there
were no other outside factors causing the problem.
*The application is made using Access 97
*1 table called "bugfix" which contains 3 records.
*there is one form with 1 button on it. The form contains the following
code:
***************************
Option Compare Database
Option Explicit
Private Sub Command0_Click()
DoIt
End Sub
Private Sub DoIt()
Dim rts As Recordset
Dim db As Database
Dim t As Long
Set db = CurrentDb
Set rts = db.OpenRecordset("SELECT * FROM bugfix")
t = rts.RecordCount
End Sub
***************************
Since the table 'bugfix' has 3 records, I would think that t should =
3.
It doesn't; it equals 1.
Why?
Thanks for any help in advance!