G
Guest
Thanks for taking the time to respond
I have code which is called from the switchboard that gets the current user logged into my database and then adds that user to the table field. Problem is I can't get it to work. Not sure if I have something in the wrong place or the wrong code or both. I am using Access 2002. Please give me an example because I don't know what I am doing here. This is my code in a module
Function WhoUsesDb(
Dim rs As DAO.Recordse
Call GetUserName ' Gets the user name -works okay
Set rs = CurrentDb.OpenRecordset("tblUsers") 'table name is tblUsers, Field name is Use
With r
rs.Edi
rs.AddNe
rs![User] = ap_GetUserNam
rs.Updat
End Wit
rs.Clos
Set rs = Nothin
I have code which is called from the switchboard that gets the current user logged into my database and then adds that user to the table field. Problem is I can't get it to work. Not sure if I have something in the wrong place or the wrong code or both. I am using Access 2002. Please give me an example because I don't know what I am doing here. This is my code in a module
Function WhoUsesDb(
Dim rs As DAO.Recordse
Call GetUserName ' Gets the user name -works okay
Set rs = CurrentDb.OpenRecordset("tblUsers") 'table name is tblUsers, Field name is Use
With r
rs.Edi
rs.AddNe
rs![User] = ap_GetUserNam
rs.Updat
End Wit
rs.Clos
Set rs = Nothin