Delete problem

thart21

Registered User.
Local time
Today, 15:11
Joined
Jun 18, 2002
Messages
236
I have a form with a combo box with the recordsource of:

SELECT [SubType].[SubTypeID], [SubType].[SubType] FROM SubType;

I have a delete record button:

Private Sub delete_Click()
Dim strInput As String
Dim strMsg As String
DoCmd.SetWarnings False
Beep
strMsg = "This action can only be done by authorized users" & vbCrLf & vbLf & "Please enter password"
strInput = InputBox(prompt:=strMsg, Title:="Delete Record")
If strInput = "thart" Then 'password is correct
DoCmd.RunCommand acCmdDeleteRecord
Else 'password is incorrect
MsgBox "Incorrect Password!" & vbCrLf & vbLf & "Please try again.", vbCritical, "Invalid Password"
Exit Sub
End If

End Sub

When "Delete" is clicked, the record disappears as it should but the "Subtype" item that was applied to it is completely deleted from the "Subtype" table and I have to go in and readd it each time.

What can I do to keep this table intact? I have several other combo boxes all pulling from different tables in the same manner and they are left alone. I have verified that they all have the same properties/attributes so they should act the same.

Any ideas?

Thanks a lot

Toni
 

Users who are viewing this thread

Back
Top Bottom