L
lilbit27
I have a Mainform called "MainPastDue" and a Subform called "PastDues".
Currently when the user logs in they open the Mainform and click on an
Option button and a combo box appears where they can select their name
and it will filter the data in the subform based on there name.
I wanted to automate this process.
I created a table that stores their "ComputerName" and the uers name.
What I would like to happen is to take the computer name look up the
user's name that maps to the computer name and when they click on
option one filter the data automatically to show only their items
instead of them having to select their name.
Here is the code on the Afterupdate of Option 1:
Dim linker
Dim strSQL As String
linker = Frame95.Value
Select Case linker
Case 0
ittype = 0
Me.Cmdclose.SetFocus
Me.FPastDues.Form.FilterOn = False
strSQL = "TARA.NetC=0"
FPastDues.Visible = True
Me.FPastDues.Form.Filter = strSQL
Me.FPastDues.Form.FilterOn = True
What I am trying to add is this:
Me.CboName = DLookup("[EmployeeName]", "TShortNames", "[ShortName] =
FOSUserName()")
Me.CboName - is the combo box where they currently select their name.
TshortNames -is the table that stores the computer name and their name
FOSUserName- is the function I am using to capture the computer name
The Mainform and Subform record source is using another table that has
the empolyee's name and I need to somehow say after it finds the
Employee name match it to name int he main table and refilter the info.
Currently when the user logs in they open the Mainform and click on an
Option button and a combo box appears where they can select their name
and it will filter the data in the subform based on there name.
I wanted to automate this process.
I created a table that stores their "ComputerName" and the uers name.
What I would like to happen is to take the computer name look up the
user's name that maps to the computer name and when they click on
option one filter the data automatically to show only their items
instead of them having to select their name.
Here is the code on the Afterupdate of Option 1:
Dim linker
Dim strSQL As String
linker = Frame95.Value
Select Case linker
Case 0
ittype = 0
Me.Cmdclose.SetFocus
Me.FPastDues.Form.FilterOn = False
strSQL = "TARA.NetC=0"
FPastDues.Visible = True
Me.FPastDues.Form.Filter = strSQL
Me.FPastDues.Form.FilterOn = True
What I am trying to add is this:
Me.CboName = DLookup("[EmployeeName]", "TShortNames", "[ShortName] =
FOSUserName()")
Me.CboName - is the combo box where they currently select their name.
TshortNames -is the table that stores the computer name and their name
FOSUserName- is the function I am using to capture the computer name
The Mainform and Subform record source is using another table that has
the empolyee's name and I need to somehow say after it finds the
Employee name match it to name int he main table and refilter the info.