Home > Microsoft Access Help > Getrows - strange problem need help

Getrows - strange problem need help



I'm doing this to get data from one of my queries that has at least 300 records in it. I only come up with one record each time. Why is it? I can't see the problem. Can somebody tell me?

thanks.


Code:


 
Dim db As Database
Dim rs3 As Recordset
Dim varconcat As Variant
Dim gradArray As Variant
Dim strcriteria As String
Dim strsql2 As String

Set db = CurrentDb

Dim NumRecords As Integer

strsql2 = "select * from qryTrgrds "
Set rs3 = db.OpenRecordset(strsql2, dbOpenSnapshot)

gradArray = rs3.GetRows
NumRecords = UBound(gradArray, 2) + 1



    
Guest


Quote:
Originally Posted by trevi
I'm doing this to get data from one of my queries that has at least 300 records in it. I only come up with one record each time. Why is it? I can't see the problem. Can somebody tell me?

thanks.


Code:


 
Dim db As Database
Dim rs3 As Recordset
Dim varconcat As Variant
Dim gradArray As Variant
Dim strcriteria As String
Dim strsql2 As String

Set db = CurrentDb

Dim NumRecords As Integer

strsql2 = "select * from qryTrgrds "
Set rs3 = db.OpenRecordset(strsql2, dbOpenSnapshot)

gradArray = rs3.GetRows
NumRecords = UBound(gradArray, 2) + 1




Well, maybe I forgot but when I put a number, like '1000' in the getrows getrows(1000).... it works. But I remember not doing that. I thought the default was for getrows to get the number of records. I guess I need to study more.

Was this answer helpful ? Yes No   
Guest
 
 
Home - About Infoqu - Contact - Privacy Statement - Link to Infoqu - Bookmark Infoqu

Copyright 2007-2008 by Infoqu. All rights reserved