Zoptooniek
New member
- Local time
- Today, 21:55
- Joined
- Jun 22, 2011
- Messages
- 4
Hi All,
I'm not a great developer or anything, I just do what I know and what I've picked up frm forums so I have a question here which i'm hoping can be answered very easily by you experts!
Basically I have a Case Statement that I have written as a Public Function within it's own Module.
EG of My Public Function:
Public Function GetUserInfo()
Dim Username As String
Dim DisplayName As String
Dim Department As String
Username = Environ("username")
Select Case Username
Case "Adam"
DisplayName = "Adam Smith"
Department = "Claims"
End Select
End Function
The full case statement has more cases within it.
What I am trying to achieve is to return the DisplayName & Department results and populate some fields on a form when it loads.
The only thing that I'm stuck on is how to return these values back to my code in the OnLoad Sub on my form.
The reason that I want this case statement as a Public Function is because I will be using it for several different fields and do not wish to keep having to write this long Case Statement for each field on my form.
Any help would be greatly appreceated!
I'm not a great developer or anything, I just do what I know and what I've picked up frm forums so I have a question here which i'm hoping can be answered very easily by you experts!
Basically I have a Case Statement that I have written as a Public Function within it's own Module.
EG of My Public Function:
Public Function GetUserInfo()
Dim Username As String
Dim DisplayName As String
Dim Department As String
Username = Environ("username")
Select Case Username
Case "Adam"
DisplayName = "Adam Smith"
Department = "Claims"
End Select
End Function
The full case statement has more cases within it.
What I am trying to achieve is to return the DisplayName & Department results and populate some fields on a form when it loads.
The only thing that I'm stuck on is how to return these values back to my code in the OnLoad Sub on my form.
The reason that I want this case statement as a Public Function is because I will be using it for several different fields and do not wish to keep having to write this long Case Statement for each field on my form.
Any help would be greatly appreceated!