Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 4th, 2006, 10:56 AM
Registered User
 
Join Date: Nov 2006
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.Refresh
    .Parameters("acct()") = "qryDistinctAcct"

    Set rs = .Execute
End With

rs.Close
Set rs = Nothing
Set cmd = Nothing

End Sub





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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.