|
-
Aug 2nd, 2000, 01:15 PM
#1
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?
-
Aug 2nd, 2000, 01:37 PM
#2
Monday Morning Lunatic
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.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|