Hi
I want to filter the task datasheet based on the user who logged in database as per their loginID.
I have subform called frmMyTasks which will show the task related to employee on their login once he logged in.
I want procedure to check that LoginID with tblUserSecurity LoginID and filter the tasks which is assigned to him in tblTask [TaskAssignTo] field equals EmpID of that user only.
"tblTask".[TaskID] is PK numeric
"tblTask".[TaskAssignTo] is numeric
"tblUserSecurity".[LoginID] is PK text
"tblEmployees".[EmpID] is PK numeric
if incase you required on navigation form there is text box called txtLoginID which will be filled with user's loginID when he successfully logged in database.
I want to filter the task datasheet based on the user who logged in database as per their loginID.
I have subform called frmMyTasks which will show the task related to employee on their login once he logged in.
I want procedure to check that LoginID with tblUserSecurity LoginID and filter the tasks which is assigned to him in tblTask [TaskAssignTo] field equals EmpID of that user only.
Code:
Private Sub Form_Load()
Dim MyLogin As String
Dim Task As String
Dim TaskAssignTo As Integer
MyLogin = DLookup("LoginID", "tblUserSecurity", "EmpID = '" & TaskAssignTo & "'")
Task = "SELECT * from DueDate where TaskAssignTo = '" & MyLogin & ")"
Me.RecordSource = Task
End Sub
"tblTask".[TaskID] is PK numeric
"tblTask".[TaskAssignTo] is numeric
"tblUserSecurity".[LoginID] is PK text
"tblEmployees".[EmpID] is PK numeric
if incase you required on navigation form there is text box called txtLoginID which will be filled with user's loginID when he successfully logged in database.