troubleshooting Question

tempvars show as null when used in a function!

Avatar of Peter Groves
Peter Groves asked on
Microsoft AccessVBA
2 Comments1 Solution118 ViewsLast Modified:
tempvars variable does not show value when used in function!  

I set the variable in a login form to use throughout the project and that works fine!
TempVars.Add "log_usr", UserName

But when I try to use it in a function it shows NULL.

On a form I put this on a button! I'll use it on an autokeys macro later once it works!  
    DoCmd.OpenFunction Open_user_text()

    Function Open_user_text()


       

        MsgBox (" User =") & tempvars!UserName
 

    End Function



Thanks

Pete
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros