Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logging onto database

Status
Not open for further replies.

shaunacol

Programmer
Jan 29, 2001
226
GB
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

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top