S
Sandy
Hello -
The following code is supposed to just update a user's security settings
when the user's name is highlighted in a listbox (lstUsers). What it's doing
is just adding a user instead of changing the AccessID and ViewID on the
highlighted user. (The highlighted user's info appears in the textboxes.)
What am I doing wrong?
<snip>
If Not lstUsers.Value = "" Then
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("tblSecurity", dbOpenDynaset)
With rst
.Edit
![Password] = Me.txtPassword
![UserID] = Me.txtUserID
![Active] = Me.txtActive
![AccessID] = Me.txtAccessID
![ViewID] = Me.txtViewID
.Update
End With
If IsLoaded("fmAdmin") Then
Forms!frmAdmin.Requery
Forms!frmAdmin.lstUsers.Requery
End If
<snip>
Any help will be greatly appreciated!
The following code is supposed to just update a user's security settings
when the user's name is highlighted in a listbox (lstUsers). What it's doing
is just adding a user instead of changing the AccessID and ViewID on the
highlighted user. (The highlighted user's info appears in the textboxes.)
What am I doing wrong?
<snip>
If Not lstUsers.Value = "" Then
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("tblSecurity", dbOpenDynaset)
With rst
.Edit
![Password] = Me.txtPassword
![UserID] = Me.txtUserID
![Active] = Me.txtActive
![AccessID] = Me.txtAccessID
![ViewID] = Me.txtViewID
.Update
End With
If IsLoaded("fmAdmin") Then
Forms!frmAdmin.Requery
Forms!frmAdmin.lstUsers.Requery
End If
<snip>
Any help will be greatly appreciated!