Avatar of Peter Groves
Peter Groves

asked on 

tempvars show as null when used in a function!

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


Microsoft AccessVBA

Avatar of undefined
Last Comment
Peter Groves

8/22/2022 - Mon