Hi
I have the code below which gets a recordset from a db and add it to an array with the function getrows(). My problem is that it only get the first row and not the entire table.
I have worked with asp and there it just uboun(arrayname), and then you have the max row of the array... should it not be as easy in MS Access ?
Code :
Dim db As DAO.Database
Dim tblRstApp As DAO.Recordset
Dim tblRstAppSupTbl As DAO.Recordset
Dim AppSubTbl as Variant
Dim i
Set db = CurrentDb()
Set tblRstAppSupTbl = db.OpenRecordset("TBL_AppSupTbl", dbOpenDynaset)
AppSubTbl = tblRstAppSupTbl.GetRows()
tblRstApp.FindFirst "ApproverID =" & varApproverID
Me.txtSubmitter.Value = tblRstApp("Submitter")
For i = 0 To UBound(AppSubTbl, 2)
If tblRstApp("DestTable") = AppSubTbl(1, i) Then
Me.txtDestTable = AppSubTbl(2, i)
Exit For
End If
Next
I have the code below which gets a recordset from a db and add it to an array with the function getrows(). My problem is that it only get the first row and not the entire table.
I have worked with asp and there it just uboun(arrayname), and then you have the max row of the array... should it not be as easy in MS Access ?
Code :
Dim db As DAO.Database
Dim tblRstApp As DAO.Recordset
Dim tblRstAppSupTbl As DAO.Recordset
Dim AppSubTbl as Variant
Dim i
Set db = CurrentDb()
Set tblRstAppSupTbl = db.OpenRecordset("TBL_AppSupTbl", dbOpenDynaset)
AppSubTbl = tblRstAppSupTbl.GetRows()
tblRstApp.FindFirst "ApproverID =" & varApproverID
Me.txtSubmitter.Value = tblRstApp("Submitter")
For i = 0 To UBound(AppSubTbl, 2)
If tblRstApp("DestTable") = AppSubTbl(1, i) Then
Me.txtDestTable = AppSubTbl(2, i)
Exit For
End If
Next