I have the code at the bottom working well with a new form - it is bringing in user email and name perfectly.
My question is this - how can I combine this code with a form that submits to a MS Access database?
I cannot figure out how to put this code into a form that is submitting to Access.
I also tried the other way around - I cannot figure out how to start with this code, and then add in the submitting to Access.
First post here - hopefully I asked the right question!
Thanks.
Sub XDocument_OnLoad(eventObj)
Dim objUser
Set objUser = XDocument.DOM.selectSingleNode("//my:Name")
If objUser.Text = "" Then
Dim objPhone, objEmail, objEmpID
Set objEmail = XDocument.DOM.selectSingleNode("//my:Email")
Set objADSysInfo = CreateObject("ADSystemInfo")
Set objUsr = GetObject("LDAP://" + objADSysInfo.UserName)
objUser.Text = Replace(objUsr.Get("cn"), "&", "+")
objEmail.Text = objUsr.Get("mail")
Set objADSysInfo = null
Set objUsr = null
End If
End Sub