ahbenshaut
Well-known member
Good Morning/Afternoon/Evening
I am trying to loop thru a dataset to find an exisiting employee. Here's the code I'm using once the dataset has been filled:
This is in a module so it can be accessed whenever:
Public winUser As String = Mid(GetCurrent().Name, 9, Len(GetCurrent().Name))
This is in the form code:
Dim filter As String = "NTLogin = 'bsmith'"
Dim matchrows() As DataRow = clsSecurity._dsAllEmployees.Tables("AllEmployees").Select(filter)
Dim row As DataRow
For Each row In matchrows
MessageBox.Show(row("Display Name").ToString & " " & row("Location").ToString)
Next
Everything works like it should if I leave the 'bsmith' in the first line hardcoded but I want to use the winUser as a variable since more than 1 person will be using the app. I know its just a syntax issue but I can figure it out.
Any help would be greatly appreciated
I am trying to loop thru a dataset to find an exisiting employee. Here's the code I'm using once the dataset has been filled:
This is in a module so it can be accessed whenever:
Public winUser As String = Mid(GetCurrent().Name, 9, Len(GetCurrent().Name))
This is in the form code:
Dim filter As String = "NTLogin = 'bsmith'"
Dim matchrows() As DataRow = clsSecurity._dsAllEmployees.Tables("AllEmployees").Select(filter)
Dim row As DataRow
For Each row In matchrows
MessageBox.Show(row("Display Name").ToString & " " & row("Location").ToString)
Next
Everything works like it should if I leave the 'bsmith' in the first line hardcoded but I want to use the winUser as a variable since more than 1 person will be using the app. I know its just a syntax issue but I can figure it out.
Any help would be greatly appreciated