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.
|