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 / Forms Programming / April 2005

Tip: Looking for answers? Try searching our database.

Delete command on Form/subform

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brook - 28 Apr 2005 15:48 GMT
What I am trying to accomplish is this:

When a user creates a new invoice on frminvoice, then enters the order
details in the frminvoicedetails, but then wants to delete the invoice. I
added a delete command button but it only deletes the record associated with
the main form.

How do I delete the information within the subform that is assocated with
that particular invoiceid that has been deleted?

Any suggestions?

Thanks,

Brook
Rick B - 28 Apr 2005 16:08 GMT
One way is to turn on cascading deletes in your relationship window.  When
on, any time you delete a main record, all the associated records would be
deleted.

Signature

Rick B

> What I am trying to accomplish is this:
>
[quoted text clipped - 11 lines]
>
> Brook
Brook - 28 Apr 2005 16:38 GMT
Thank you...

That worked great..

Brook

> One way is to turn on cascading deletes in your relationship window.  When
> on, any time you delete a main record, all the associated records would be
[quoted text clipped - 16 lines]
> >
> > Brook
Van T. Dinh - 28 Apr 2005 16:18 GMT
You can set Referential Integrity with Cascade Delete Related Records and
the related Child Records will be deleted automatically when the Parent
Record is deleted.  However, this is rather dangerous as it is too easy to
delete Child Records in you accidentally delete the Parent Record.

The other way is to use code to run a Delete Query / SQL String to delete
the related Child Records first before deleting the Parent Record.

Check Access VB Help on RunSQL or OpenQuery Method.

Signature

HTH
Van T. Dinh
MVP (Access)

> What I am trying to accomplish is this:
>
[quoted text clipped - 11 lines]
>
> Brook
 
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.