Hi All,
I'm trying to define a 2 dimentional array, based on the number of fields in a given recordset.
ie The outcome of the above should be col1 in array is field name (and laterly) col2 is data.
I've got the following code sample, however, its telling me I need to have a constant to define the variable.
I've tried Inet and it seems that I should be able to do it, however, it's not working.
Code as below:
TIA,
Fitz
Did you know, there are 10 types of people in this world:
* Those who understand binary
and
* Those who Don't!!
I'm trying to define a 2 dimentional array, based on the number of fields in a given recordset.
ie The outcome of the above should be col1 in array is field name (and laterly) col2 is data.
I've got the following code sample, however, its telling me I need to have a constant to define the variable.
I've tried Inet and it seems that I should be able to do it, however, it's not working.
Code as below:
Code:
Sub ReadRecords(strTable As String, dteCriteria As Date, strFieldSrch As String)
Dim rstTable As DAO.Recordset, fldField As Field, intCnt As Integer
Set rstTable = CurrentDb.OpenRecordset(strTable)
With rstTable
intCnt = rstTable.Fields.Count
Dim stra(0 To intCnt, 1) As String <- ERROR HERE!!
For i = 0 To .Fields.Count - 1
MsgBox .Fields(i).Name
Next
End With
End Sub
TIA,
Fitz
Did you know, there are 10 types of people in this world:
* Those who understand binary
and
* Those who Don't!!