View Single Post
Old 03-14-2019, 06:42 PM   #9
Zydeceltico
Newly Registered User
 
Join Date: Dec 2017
Location: Pittsburgh, PA
Posts: 617
Thanks: 461
Thanked 7 Times in 7 Posts
Zydeceltico is on a distinguished road
Re: Don't save form until record is saved on second form

Quote:
Originally Posted by theDBguy View Post
Pretty much. So, you’ll have to decide which is less work for you, make sure all ducks are in a row before saving all the records, or delete unwanted records after the fact?
What should I look at to delete after the fact? In other words - it would be a huge pain to redo all of the bound forms and I would much prefer to work out something that can run after the fact that deletes childless parents.

I just don't know what to even look at to do this.

Another great poster here gave me this:

Code:
SELECT tblinspectionevent.inspectionevent_pk 
FROM   ((((tblinspectionevent 
           LEFT JOIN tblinspectweldtests 
                  ON tblinspectionevent.inspectionevent_pk = 
                     tblinspectweldtests.inspectionevent_fk) 
          LEFT JOIN tblinspectfabrication 
                 ON tblinspectionevent.inspectionevent_pk = 
                    tblinspectfabrication.inspectionevent_fk) 
         LEFT JOIN tblinspectweldassemble 
                ON tblinspectionevent.inspectionevent_pk = 
                   tblinspectweldassemble.inspectionevent_fk) 
        LEFT JOIN tblinspectmill 
               ON tblinspectionevent.inspectionevent_pk = 
                  tblinspectmill.inspectionevent_fk) 
       LEFT JOIN tblinspectgeneral 
              ON tblinspectionevent.inspectionevent_pk = 
                 tblinspectgeneral.inspectionevent_fk 
WHERE  (( NOT ( tblinspectfabrication.inspectionevent_fk ) IS NULL )) 
        OR (( NOT ( tblinspectweldtests.inspectionevent_fk ) IS NULL )) 
        OR (( NOT ( tblinspectgeneral.inspectionevent_fk ) IS NULL )) 
        OR (( NOT ( tblinspectweldassemble.inspectionevent_fk ) IS NULL )) 
        OR (( NOT ( tblinspectmill.inspectionevent_fk ) IS NULL ));
and this:

Code:
Public Function EventHasInspections(EventID As Long) As Boolean
  EventHasInspections = (DCount("*", "qryEventsWithInspections", "InspectionEvent_PK = " & EventID) > 0)
End Function
I know what they do but I am not at all sure how to utilize them - meaning I am not sure where to PUT them.
Zydeceltico is offline   Reply With Quote