-
When you open a database using DAO you can refer to fields using recordset.fields("FieldName"). Is it possible to create an array that would use String instead of Integer?
ie;
instead of
Code:
ReDim Preserve Marek(1)
I would use
Code:
ReDim Preserve Marek("Marek")
and then access it using "Marek" as array index?
-
The DAO 'arrays' are not arrays. They are Collections, which are accessed by a 'key', usually a String value:
Code:
Dim MyCol As New Collection
Private Sub Form_Load()
MyCol.Add "Item 1", "My item"
MyCol.Add "Item 2", "A different item"
MsgBox MyCol("My item")
End Sub
They basically deal in Variants all the time, so you can add an item of pretty much any type, although there may be restrictions on indices.