This event procedure worked fine in Access 2000, but now that it's in an ADP, not. It is deleting the first record in the recordset when I click the DeleteButton rather than the selected value in the Combo0 combo control. How do I get it to delete the selected value from the combo box?
------------------------------------------------------------
Sub DeleteButton_Click()
On Error GoTo Err_DeleteButton_Click
Dim db As Database
Dim rs As Recordset
Dim dgdef As String
Dim msg As String
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Set db = CurrentDb
db.Execute "Delete * from TblDebtors Where DebtorID = " & Combo0.Column(0) & " "
Combo0.Requery
Exit_DeleteButton_Click:
Exit Sub
Err_DeleteButton_Click:
MsgBox Err.Description
Resume Exit_DeleteButton_Click
Combo0.SetFocus
End Sub
------------------------------------------------------------
Thanks-
Steve
---------------------------------------
IF WebApplicationProgrammer = True Then
ElectronicSheepHerder = True
End If
------------------------------------------------------------
Sub DeleteButton_Click()
On Error GoTo Err_DeleteButton_Click
Dim db As Database
Dim rs As Recordset
Dim dgdef As String
Dim msg As String
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Set db = CurrentDb
db.Execute "Delete * from TblDebtors Where DebtorID = " & Combo0.Column(0) & " "
Combo0.Requery
Exit_DeleteButton_Click:
Exit Sub
Err_DeleteButton_Click:
MsgBox Err.Description
Resume Exit_DeleteButton_Click
Combo0.SetFocus
End Sub
------------------------------------------------------------
Thanks-
Steve
---------------------------------------
IF WebApplicationProgrammer = True Then
ElectronicSheepHerder = True
End If