PC Review


Reply
Thread Tools Rate Thread

passing recordset to sub

 
 
alan fisher
Guest
Posts: n/a
 
      30th Jan 2004
I have a procedure that updates a table with values from a
recordset and would like to handle the operation in a sub
since I do the same thing in several places within an
If..Then...Else statement. I created a sub called
UpdateEffectiveTable(rs as recordset). I then passed the
name of the recordset to the Sub. I am updating the
recorset with variables which are set in the main
procedure and during compile I get an error in the sub
because the variable is not recognized. Can I pull the
value of the variable from the Sub as opposed to passing
the value when I run it. Thanks for any help.
 
Reply With Quote
 
 
 
 
TC
Guest
Posts: n/a
 
      30th Jan 2004
The variables that are defined in the main procedure will not be visible to
the called sub procedure unless (a) you define them as gloabl to both
procedures - bad, or (2) you explicitly pass them to the sub procedure, as
parameters (along with the recordset).

HTH,
TC


"alan fisher" <(E-Mail Removed)> wrote in message
news:695e01c3e6c2$c18f6530$(E-Mail Removed)...
> I have a procedure that updates a table with values from a
> recordset and would like to handle the operation in a sub
> since I do the same thing in several places within an
> If..Then...Else statement. I created a sub called
> UpdateEffectiveTable(rs as recordset). I then passed the
> name of the recordset to the Sub. I am updating the
> recorset with variables which are set in the main
> procedure and during compile I get an error in the sub
> because the variable is not recognized. Can I pull the
> value of the variable from the Sub as opposed to passing
> the value when I run it. Thanks for any help.



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing ADO Recordset into a Sub procedure JDB Microsoft Access VBA Modules 1 21st Jun 2008 04:22 AM
Passing Recordset from C# to VBScript =?Utf-8?B?UmFodnlu?= Microsoft C# .NET 0 28th Mar 2007 02:04 AM
passing a recordset =?Utf-8?B?ODVhc2NNY0xhcmVu?= Microsoft Access Reports 1 6th Aug 2005 05:16 PM
Passing an ADODB.Recordset from VB6 to VB.Net Dot Netizen Microsoft ADO .NET 0 10th Jan 2005 09:15 PM
Passing a recordset to a form Matthew DeAngelis Microsoft Access Form Coding 2 19th Aug 2004 04:35 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:12 PM.