R
Roland
Anybody there? Please help. I using Access Versions 11. Below is the code
that I'm having the above error message with. I'm trying to create a
recordset from an access table. I plan on using the recordset in some codes
to follow which is not included in this pasted codes (trying to create
something similar to a cursor in plsql). Also, after I get my recordset, how
do I retrieve the current record?
Private Sub Form_Current()
Dim db As ADODB.Connection
Dim UserGroupRst As ADODB.Recordset
Dim SqlStmt As String
Set db = CurrentProject.Connection
Set UserGroupRst = New ADODB.Recordset
SqlStmt = "SELECT DISTINCTROW AdministerSecurity.GroupName " & _
"FROM AdministerSecurity " & _
"Where AdministerSecurity.UserId = " & CurrentUser
UserGroupRst.Open SqlStmt, db, adOpenStatic, adLockReadOnly, adCmdTable
UserGroupRst.Close
db.Close
End Sub
Thanks in Advance!
Roland
that I'm having the above error message with. I'm trying to create a
recordset from an access table. I plan on using the recordset in some codes
to follow which is not included in this pasted codes (trying to create
something similar to a cursor in plsql). Also, after I get my recordset, how
do I retrieve the current record?
Private Sub Form_Current()
Dim db As ADODB.Connection
Dim UserGroupRst As ADODB.Recordset
Dim SqlStmt As String
Set db = CurrentProject.Connection
Set UserGroupRst = New ADODB.Recordset
SqlStmt = "SELECT DISTINCTROW AdministerSecurity.GroupName " & _
"FROM AdministerSecurity " & _
"Where AdministerSecurity.UserId = " & CurrentUser
UserGroupRst.Open SqlStmt, db, adOpenStatic, adLockReadOnly, adCmdTable
UserGroupRst.Close
db.Close
End Sub
Thanks in Advance!
Roland