Hi,
I have a database that is used to log absences, I use the users network login to identify them and display data that is held about them within a specific table (tblusers), the database has started to fail when it opens for a random select group.
the main form is a bound form using this query
fosusername() function is
the message box finds the username and displays this and then the form shows no data and all controls are gone - probably becauase it is bound and cant find the username - but the msgbox does find the username
the form is bound by the above query - when you run the query separately it doesn't find the data from the function, but you run the function and it does find the data.
the users do exist in the table and everything is correct.
any ideas what maybe cuasing this
Hope this is of use, Rob.
I have a database that is used to log absences, I use the users network login to identify them and display data that is held about them within a specific table (tblusers), the database has started to fail when it opens for a random select group.
the main form is a bound form using this query
Code:
SELECT tblUsers.LoginID, tblUsers.ManagerName, tblUsers.Campaign, tblUsers.EmailAddress, tblAgentListing.OPSManager
FROM tblUsers INNER JOIN tblAgentListing ON tblUsers.ManagerName = tblAgentListing.LineManager
WHERE (((tblUsers.LoginID)=fOSUserName()));
fosusername() function is
Code:
Function fOSUserName() As String
fOSUserName = UserNameWindows
MsgBox UserNameWindows
End Function
Function UserNameWindows() As String
Dim lngLen As Long
Dim strBuffer As String
Const dhcMaxUserName = 255
strBuffer = Space(dhcMaxUserName)
lngLen = dhcMaxUserName
If CBool(GetUserName(strBuffer, lngLen)) Then
UserNameWindows = Left$(strBuffer, lngLen - 1)
Else
UserNameWindows = ""
End If
End Function
the form is bound by the above query - when you run the query separately it doesn't find the data from the function, but you run the function and it does find the data.
the users do exist in the table and everything is correct.
any ideas what maybe cuasing this
Hope this is of use, Rob.