I am trying to set a global string that can be used on multiple forms. I created a standard module and put the following code in it but I am getting an error when I try to compile the vba code. The error is "Invalid Outside Procedure". Why can't I use a DLookup in this situation? Or can I and I just have it set up wrong?
' Stores Initials of Current User to store Estimator Control value
Global strEstimator As String
strEstimator = DLookup("[Initials]", "qryGetUserName", "[UserName]=WindowsUserName()")