My front end database is in MS Access 2010 and my back end resides on sharepoint in office 365 as lists. It is all working well but I want to be able to open the database and run some code which checks who the current windows user is and then opens up the appropriate form. They are already required to log onto sharepoint to get access to their tables so I want to make the logon to MS Access seemless for them. The issue is that I dont know where I would put this code......
I have started writing it based on what I know so far but since i dont know where to put it I cant test if this works.
Private Sub Logon()
Public eUser As String = System.Environment.UserName.ToString
If eUser = Chris or Caroline Then
DoCmd.OpenForm "MANAGER"
Else
DoCmd.OpenForm "my_data Staff", , , "[ID]=" & [CboEmployee]
End If
End Sub
I have started writing it based on what I know so far but since i dont know where to put it I cant test if this works.
Private Sub Logon()
Public eUser As String = System.Environment.UserName.ToString
If eUser = Chris or Caroline Then
DoCmd.OpenForm "MANAGER"
Else
DoCmd.OpenForm "my_data Staff", , , "[ID]=" & [CboEmployee]
End If
End Sub