S
szag via AccessMonster.com
I am struggling with assigning user name to a table. I can get it to populate
in a form but I want to push it right to a table. Here is the code I was
trying to use but I get the error:
User defined type not defined related to the “New ADODB.Recordsetâ€
The code...
Private Sub Form_Load()
Set dbs = CurrentDb
Set rs = New ADODB.Recordset
Set cn = CurrentProject.Connection
sqlString = "select * from tblUser"
rs.Open sqlString, cn, adOpenDynamic, adLockOptimistic
rs.AddNew
rs![UserName] = Environ("UserName")
rs.Update
rs.Close
Set cn = Nothing
Set rs = Nothing
Set dbs = Nothing
End Sub
in a form but I want to push it right to a table. Here is the code I was
trying to use but I get the error:
User defined type not defined related to the “New ADODB.Recordsetâ€
The code...
Private Sub Form_Load()
Set dbs = CurrentDb
Set rs = New ADODB.Recordset
Set cn = CurrentProject.Connection
sqlString = "select * from tblUser"
rs.Open sqlString, cn, adOpenDynamic, adLockOptimistic
rs.AddNew
rs![UserName] = Environ("UserName")
rs.Update
rs.Close
Set cn = Nothing
Set rs = Nothing
Set dbs = Nothing
End Sub