M mms180 Guest Aug 30, 2002 #1 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
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
C charityg Registered User. Local time Today, 20:10 Joined Apr 17, 2001 Messages 634 Aug 30, 2002 #2 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: Aug 30, 2002
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