I'm using an AfterUpdate event that i haven't completed, but can't find a related topic on bytes to help me finish it, so i thought i'd ask.
I think i need the code to remember the original value so it can find and delete it because what i have so far uses the new value to find and delete, which doesn't exist. The insert part seems to be working and the requery part works as well.
Expand|Select|Wrap|Line Numbers
- Private Sub CC_Security_1_TextBox_AfterUpdate()
- If Me.CC_Security_1_TextBox = "" Then
- CurrentDb.Execute " DELETE * FROM [CC Security] WHERE User = '" & Me.User_ID & "' AND [CC Security] = '" & Me.CC_Security_1_TextBox & "';"
- Else
- CurrentDb.Execute " INSERT INTO [CC Security] ( [User], [CC Security Rule] ) VALUES ('" & Me.User_ID & "', '" & Me.CC_Security_1_TextBox & "');"
- End If
- Dim holdID As String
- holdID = Me.User_ID.Value
- Me.Requery
- Set rs = Me.RecordsetClone
- rs.FindFirst "[User ID] ='" & holdID & "'"
- Me.Bookmark = rs.Bookmark
- End Sub
Thanks,
Omar