How to make form to delete record from table in Access 2002

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
szms
Forum Contributor
Posts: 101
Joined: Thu Jun 26, 2003 12:23 pm

How to make form to delete record from table in Access 2002

Post 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.
User avatar
AVATAr
Forum Regular
Posts: 524
Joined: Tue Jul 16, 2002 4:19 pm
Location: Uruguay -- Montevideo
Contact:

Post 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 ...
szms
Forum Contributor
Posts: 101
Joined: Thu Jun 26, 2003 12:23 pm

Post 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.
szms
Forum Contributor
Posts: 101
Joined: Thu Jun 26, 2003 12:23 pm

Post 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
Post Reply