Link to home
Start Free TrialLog in
Avatar of RWayneH
RWayneHFlag for United States of America

asked on

Retaining a value

I use the code below to determine a value, however later in the procedure I would like to use it again and the value is empty?  Is there a way to make this a global value so it is not lost?  Or a way to carry the value from one procedure to another?  Trying to determine just where I am losing it.

session.findById("wnd[0]/usr/ctxtRMMG1-MATNR").Text = strValidMatlNum
ASKER CERTIFIED SOLUTION
Avatar of Glenn Ray
Glenn Ray
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RWayneH

ASKER

It worked!!  Thanks... but if some reason I could not use Ln1?  I made the procedure stop at places were I was setting a variable to Y or X...  different one..  After I commented that out it worked.  Any thoughts on the Ln 1
Avatar of Norie
Norie

RWayneH

You should always use Option Explicit as it helps you find undeclared variables, and you should always declare your variables.:)
^ What imnorie said.    If you add the Option Explicit and then do a compile (VBA menu: Debug - Compile VBA Project) you'll be alerted to any/all undeclared variables.

-Glenn
Avatar of RWayneH

ASKER

Thanks for the help.
You're welcome.