T
ToniS
I have the following code and was having problems returning all of the
records out of the table. I was only getting the first record. I finall
changed the line 'vardata = rsTblPO.GetRows()' to to 'vardata =
rstblPO.GetRows(5)' and was finally able to get 4 of the records. The help
within VBA states if a value is passed in GetRows, it will return all of the
rows. I have no idea how many rows will be in the table. What is the best
way to set the recordset with all of the data?
Below is what I have
Dim iRowCount As Variant
Dim rsTblPO As DAO.Recordset
Dim vardata As Variant
strSQL = "SELECT tbl_po.[store#], tbl_po.Amount, tbl_po.[Page#] FROM
tbl_PO ORDER BY tbl_po.[Store#]"
Set rsTblPO = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset)
' vardata = rsTblPO.GetRows() ' why cant I get all of the rows?
vardata = rsTblPO.GetRows(5)
iRowCount = UBound(vardata, 2)
records out of the table. I was only getting the first record. I finall
changed the line 'vardata = rsTblPO.GetRows()' to to 'vardata =
rstblPO.GetRows(5)' and was finally able to get 4 of the records. The help
within VBA states if a value is passed in GetRows, it will return all of the
rows. I have no idea how many rows will be in the table. What is the best
way to set the recordset with all of the data?
Below is what I have
Dim iRowCount As Variant
Dim rsTblPO As DAO.Recordset
Dim vardata As Variant
strSQL = "SELECT tbl_po.[store#], tbl_po.Amount, tbl_po.[Page#] FROM
tbl_PO ORDER BY tbl_po.[Store#]"
Set rsTblPO = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset)
' vardata = rsTblPO.GetRows() ' why cant I get all of the rows?
vardata = rsTblPO.GetRows(5)
iRowCount = UBound(vardata, 2)