Page 1 of 1
How to make form to delete record from table in Access 2002
Posted: Tue Jun 29, 2004 9:34 am
by szms
I like to give First Name and Last Name in two different text box and then hit the delete button (command button). Then it will do a query to find the person and delete the corresponding record from the table. Any kind of help will be appreciated. Thank you.
Posted: Tue Jun 29, 2004 11:03 am
by AVATAr
Do you try something?
What you've discribed is ok.
Just make a script that shows First Name / Last Name with a button (dinamically make the name of that button like an array, like name[$id]).
When you post that form you fetch the $id and make the sql ...
Posted: Tue Jun 29, 2004 11:50 am
by szms
I am new in creating form in MS Access. It would be great if you let me know little me more in detail. Thank you.
Posted: Wed Jun 30, 2004 7:55 am
by szms
I ma pretty sure that event procedure need to be used for this problem. But nor sure where to change the following code to make things happen.
Option Compare Database
Private Sub Command2_Click()
On Error GoTo Err_Command2_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Exit_Command2_Click:
Exit Sub
Err_Command2_Click:
MsgBox Err.Description
Resume Exit_Command2_Click
End Sub