Save, Delete Buttons in EditMode Form

L

laserized

Hello,
I ve a switchboard, in the switchboard by selecting Data Entry button a
form opens in Edit Mode.
Dont know if its the correct definition but for further info A form
opens and that form shows the tables records in tabular view.
I add 2 buttons which are Save and Delete
What I want to do is When I edit the table data shown in the form,
"After" I click the save button data will be edited and updated. Also,
When I click the Delete button The data will be deleted from the table.
How can i do that?

More info:
The form is in tablular view like an Excel table, every row ends with
the Save and Delete buttons.
So that When I clicked to the refering delete or save button it will
delete or save the record next to it..


Any helps appriciated.
Thanx
metan.
 
B

Bob M via AccessMonster.com

What is the code behind the buttons?

The code on the On Click for the delete button should be:
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
and the code on the On Click for the Save button should be:
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
 
H

HKComputer

While bob is correct, these statements are old and are available only
for backwards compatibility. I reccomend using the following
statements:

Save
DoCmd.RunCommand acCmdSaveRecord

Delete
DoCmd.RunCommand acCmdDeleteRecord

Cancel
Me.Undo

You can also turn off the warnings like this:

Private Sub cmdDelete_Click()

DoCmd.SetWarnings (WarningsOff)
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.SetWarnings (WarningsOn)

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top