Is there a more elegant way of deleting records from VB than this? >>>

daninthemix

Registered User.
Local time
Today, 13:55
Joined
Nov 25, 2005
Messages
41
Code:
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
    DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
 
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDeleteRecord

Peter
 
Any way of physically removing the data from the table by code wihtout referring to menu commands?
 
create a delete query using the form as criteria, then requery the form?

Peter
 
Or just execute a little bit of SQL.


CurrentProject.Connection.Execute "DELETE * FROM tblMyTable WHERE lngMyTableID = " & lngRecIDToDelete & ";"

Me.Requery
 
You can also set a reference to the form's RecordSetClone and use DAO to delete the record.
 

Users who are viewing this thread

Back
Top Bottom