GetRows()

Sep 8, 2006

Hi
I am trying to use GetRows() function with only one field "PO_Number". The GetRows returns a 2D Variant Array. I wanted to know how to use the array.

varPONumber = .GetRows(, , "PO_Number")

For j = LBound(varPONumber,1) To UBound(varPONumber,1)
MsgBox varPONumber(j,1)
Next j

View Replies


ADVERTISEMENT

Getrows - Strange Problem Need Help

Mar 15, 2007

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 DatabaseDim rs3 As RecordsetDim varconcat As VariantDim gradArray As VariantDim strcriteria As StringDim strsql2 As StringSet db = CurrentDbDim NumRecords As Integerstrsql2 = "select * from qryTrgrds "Set rs3 = db.OpenRecordset(strsql2, dbOpenSnapshot) gradArray = rs3.GetRows NumRecords = UBound(gradArray, 2) + 1

View 1 Replies View Related

Modules & VBA :: Unable To Get All Records By Excluding Numrows Argument In Getrows Method?

Jul 31, 2014

Why I am not able to get all records by excluding the Numrows argument in the getrows method?

Sub Test2()
Dim myrset As Recordset
Set myrset = CurrentDb.OpenRecordset("SELECT * FROM Holidays;")
myrset.MoveLast
myrset.MoveFirst
MsgBox Excel.Application.WorksheetFunction.Networkdays(#8/1/2014#, #8/31/2014#, myrset.GetRows(myrset.RecordCount))
MsgBox Excel.Application.WorksheetFunction.Networkdays(#8/1/2014#, #8/31/2014#, myrset.GetRows())
End Sub

Second MessageBox is giving a wrong value.

Is it a mandatory one? Or Do I have to do some ritual like (Movelast) before that?

(Holidays table is just having the values in the array only ie. #08/15/2014# and #08/29/2014#)

View 10 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved