Please help this rookie

  • Thread starter Thread starter mms180
  • Start date Start date
M

mms180

Guest
Hello, If anyone can help me, I will greatly appreciate it...I have a database and would like to select an entire column and assign it to an array....Can someone show me how to do this? Thank you
 
Dim db As Database
Dim rst As Recordset
Dim myarray() As Variant
Dim i As Integer


Set db = CurrentDb
Set rst = db.OpenRecordset("YourTable", dbOpenSnapshot)

rst.MoveFirst
i = 0
Do Until rst.EOF
ReDim Preserve myarray(i)
myarray(i) = rst.Fields("YourColumn")
i = i + 1
rst.MoveNext
Loop
 
Last edited:
Thank you CharityG

Thank you very much, I really appreciate this....
 

Users who are viewing this thread

Back
Top Bottom