Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / August 2006

Tip: Looking for answers? Try searching our database.

Data is deleted from Query but not in Tables..

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Newf - 22 Aug 2006 13:47 GMT
I am having a problem with DELETING files from the tables. I have the code:
Private Sub frm_cmd_Delete_Click()
On Error GoTo Err_frm_cmd_Delete_Click

   DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
   DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

Exit_frm_cmd_Delete_Click:
   Exit Sub

Err_frm_cmd_Delete_Click:
   MsgBox Err.Description
   Resume Exit_frm_cmd_Delete_Click
   
Is there more code I can place in there so the records get deleted from the
table as well as the query??

Newf

Signature

Newf
~Everyone needs a NEWFIE as a friend~

Jerry Whittle - 22 Aug 2006 15:35 GMT
Tables don't have files; however they do have fields. Are you trying to
delete fields from the table or records?

Either which way, the old DoMenuItem was always a little buggy and should be
replaced with DoCmd.RunCommand. Something like below should work if you want
to delete the record that you are currently in on the form.

DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.RunCommand acCmdSave

Actually the last line shouldn't be needed. If that doesn't delete the
record, something else is going on.

Signature

Jerry Whittle
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

> I am having a problem with DELETING files from the tables. I have the code:
> Private Sub frm_cmd_Delete_Click()
[quoted text clipped - 14 lines]
>
> Newf
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.