[AccessD] Preventing childless parent records

Liz Doering ldoering at symphonyinfo.com
Mon Mar 6 17:46:41 CST 2006


Don,

Both are a common problem. :)

Can you make a default child record, which is saved along with the
parent record?  Or not let her close the form until she's added child
records?  (On the OnClose event of the form, open a recordset (Select
ParentID from ChildTable where ParentID = lngMyNewRecord) and test for
EOF.  If EOF = true, then Cancel = True.)

I usually handle this with a little unbound pop-up form that collects
the must-have data for both records, has an OK button with the code to
create both records, then displays both partially filled records for the
user to make changes.  

HTH,

Liz 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Mcgillivray,
Don [IT]
Sent: Monday, March 06, 2006 4:46 PM
To: AccessD
Subject: [AccessD] Preventing childless parent records

Hello, All

I have a data entry form for entering transactions where the main form
holds the transaction header and a subform holds the header's details.
Works as advertised, except that I have a user who has a habit of
creating headers without adding line items.  She sets up the header,
tabs into the line item section, gets distracted (I guess), returns to
the form (after dealing with the distraction) and starts over for some
reason.  Now, by virtue of having tabbed into the line item section, the
header was saved, but because no line items were ever entered, the
header is an orphan, or, more accurately, a childless parent.  Every
week, I scan the data and find several of these records that need to be
removed.  

My first approach was to educate the user about how to do data entry.  
My second approach was to educate the user about how NOT to do data
entry.

Both approaches netted me that vacant nodding smile that says "I don't
know what you're talking about, but if I keep nodding like this, maybe
you'll go away and leave me alone."  I'm sure you're all familiar with
that look.

This must be a common problem - the childless parent record, not the
vacant nodding smile - but I'm struggling with how to detect the
condition and disallow it.  Can anybody point me in the right direction?

Thanks!

Don

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com







More information about the AccessD mailing list