Interesting .. Why is this happening?

Demona

How was that for ya?
Local time
Today, 00:35
Joined
May 25, 2003
Messages
27
I've had a delete user query for some time now and never noticed what it was doing until today. The Query goes like this:

Name
User Table
Where
[Forms]![Delete User Form]![Name]

and

AccessLevel
User Table
Where
<> "Administration"

Okay, this is all good. The Button for this is on a form with a ComboBox that lists the names of the individuals in the User Table. When I select the user to be deleted from the User Table you go through the regular prompts for the deletion and the user is deleted, but then the user at the top of the table has there name changed to the user that was just deleted.

The VB for the button is:

Option Compare Database

'-- delete user from the database

Private Sub Delete_User_Button_Click()
On Error GoTo Err_Delete_User_Button_Click

Dim stDocName As String

stDocName = "Delete User Query"
DoCmd.OpenQuery stDocName, , acEdit
DoCmd.Close

Exit_Delete_User_Button_Click:
Exit Sub

Err_Delete_User_Button_Click:
MsgBox Err.Description
Resume Exit_Delete_User_Button_Click

End Sub

Why is the query doing that to the table and can it be stopped.

Thanks

Love and Kisses

Demons
 
I am not sure why this is happening, but two suggestions.

1. Change your control that is currently named 'Name' to something else as Name is a reserved word in Access.

2. Use the records Primary key as your criteria, not their name.

Jack
 

Users who are viewing this thread

Back
Top Bottom