rEALLY qUICK qUESTION - 500 POINTS by 10:15AM
I have the following code, i can see the form name when i put in break points and it is correct, i can run the sub with a hand coded value that is teh same as form name in the following ![FormName]! below but for some reason it will not take the formName that is passed in the var FormName??? How can i get this to work?
Public Sub StartMeUp(FormName As String)
strUserName = Environ("username")
' Select organization from the database based on the Windows UserName
Dim db As DAO.Database, qdf As DAO.QueryDef, rs As DAO.Recordset
Dim sSQL As String
Dim strOrganization As String
Set db = CurrentDb
sSQL = "SELECT MAIN_Users.Organization FROM MAIN_Users WHERE (((MAIN_Users.WindowsUserN
ame)='" & strUserName & "'));"
Set rs = CurrentDb.OpenRecordset(sS
QL)
If rs.EOF Then Exit Sub
userOrg = rs!Organization & "1"
stCatLinkCriteria = "Category = '" & userOrg & "'"
' Now reset the pivture based on the user login.
headerImg = CurrentProject.Path & "\Images\header_" & userOrg & ".jpg"
Forms![FormName]![imgHeade
r].Picture
= headerImg
End Sub
Start Free Trial