|
-
Mar 8th, 2005, 06:16 AM
#1
Thread Starter
New Member
How can I create an array from a table (VBA) ???
Hello,
I need to create an array from a table of bank holiday dates.
I just want some code that run's down each date in "Table1" and writes this information to an array, as this is needed for another VBA function.
Please HELP.
Steve 
-
Mar 8th, 2005, 06:17 AM
#2
Thread Starter
New Member
Re: How can I create an array from a table (VBA) ???
Sorry I forgot to mention, the above is in Access 2000
Steve 
-
Mar 8th, 2005, 10:01 AM
#3
Junior Member
Re: How can I create an array from a table (VBA) ???
Hi..
easiest to do this is using method GetRows() of the ADO-RecordSet object.
GetRows() returns a 2 dimensional array.
VB Code:
Dim rs As ADODB.Recordset
Dim va As Variant
Set rs = CurrentProject.Connection.Execute("select * from Table1")
va = rs.GetRows()
visit access 2000 online help for detailed information about GetRows.
Ivo
-
Mar 8th, 2005, 10:11 AM
#4
Thread Starter
New Member
Re: How can I create an array from a table (VBA) ???
It could be me, but can not get that code to work correctly at my PC at work ????
Steve 
-
Mar 8th, 2005, 11:23 AM
#5
Re: How can I create an array from a table (VBA) ???
What is your error message ??
Have you got a reference to ADO in your database ??
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
|