Locopete99
Registered User.
- Local time
- Today, 07:25
- Joined
- Jul 11, 2016
- Messages
- 163
Good Morning,
I have a subform that is running off of the below query
I also am using the fOSUserName code by Dev Ashish to find the current user
On my subform I have the field "Assigned To".
I have about 40 people using this form. but I want each user to only see their own records on the subform, so where the user on the database is the same as the fOSUserName (all users are done by the windows login, so should be the same as fOSUserName.)
Now as there are 40 people using this, i dont want the fOSUserName to be the criteria on the query, I just want to be able to filter the subform.
How would I do this??
I have a subform that is running off of the below query
Code:
SELECT Tbl_ReqType.ID, Tbl_ReqType.[Part Number], Tbl_ReqType.[Assigned To]
FROM Tbl_ReqType
WHERE (((Tbl_ReqType.[Assigned To])="Customer Care") AND ((Tbl_ReqType.Complete)=False)) OR (((Tbl_ReqType.[Assigned To])="jmorris") AND ((Tbl_ReqType.Complete)=False)) OR (((Tbl_ReqType.[Assigned To])="lpurser") AND ((Tbl_ReqType.Complete)=False));
I also am using the fOSUserName code by Dev Ashish to find the current user
Code:
Function fOSUserName() As String
' Returns the network login name
Dim lngLen As Long, lngX As Long
Dim strUserName As String
strUserName = String$(254, 0)
lngLen = 255
lngX = apiGetUserName(strUserName, lngLen)
If (lngX > 0) Then
fOSUserName = Left$(strUserName, lngLen - 1)
Else
fOSUserName = vbNullString
End If
End Function
On my subform I have the field "Assigned To".
I have about 40 people using this form. but I want each user to only see their own records on the subform, so where the user on the database is the same as the fOSUserName (all users are done by the windows login, so should be the same as fOSUserName.)
Now as there are 40 people using this, i dont want the fOSUserName to be the criteria on the query, I just want to be able to filter the subform.
How would I do this??