Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Access 2003 VBA Programmer's Reference
This is the forum to discuss the Wrox book Access 2003 VBA Programmer's Reference by Patricia Cardoza, Teresa Hennig, Graham Seach, Armen Stein; ISBN: 9780764559037
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Access 2003 VBA Programmer's Reference section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 4th, 2006, 10:56 AM
Registered User
Join Date: Nov 2006
Location: , MD, .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default passing parameter array

I am trying to pass an array list of distinct values to a query. I am new to VB and am really having difficulty with this problem. Below is code taken from the Access 2003 VBA Programmer's Reference but it fails when trying to populate the array (using distinct query to populate values). Can someone correct my error? I need to use the parameters as input to another query that will output the distinct account records to an excel file.

Sub test()

Dim parm As ADODB.Parameter
Dim cmd As ADODB.Command
Dim rs As ADODB.Recordset

Set parm = New ADODB.Parameter
Set cmd = New ADODB.Command
Set rs = New ADODB.Recordset

With cmd
    .ActiveConnection = CurrentProject.Connection
    .CommandText = "qryCustom"
    .CommandType = adCmdTable
    .Parameters("acct()") = "qryDistinctAcct"

    Set rs = .Execute
End With

Set rs = Nothing
Set cmd = Nothing

End Sub
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Two Dimensional Array as parameter Manisha0605 .NET Framework 1.x 0 February 7th, 2007 04:15 PM
Array to ref parameter dedex C# 4 February 12th, 2005 02:58 PM
Passing php array values to javascript array gkrishna Pro PHP 0 November 6th, 2004 03:20 AM
passing parameter.. suzila VB.NET 2002/2003 Basics 7 May 17th, 2004 08:28 PM
Passing Parameter tgopal Javascript 3 August 7th, 2003 07:54 PM

All times are GMT -4. The time now is 11:39 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.