A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Required data on subforms



 
 
Thread Tools Display Modes
  #1  
Old November 6th, 2009, 07:51 PM posted to microsoft.public.access.forms
Rob M[_3_]
external usenet poster
 
Posts: 4
Default Required data on subforms

Hi group,

I have an Access parent form with two subforms. I'm wondering whether
there's a way to "force" people to enter data on one field in each
subform, or else not save any data (parent data included) at all.

If it's relevant, the parent form is supplied by a query. Each
subform is supplied by its own table. Each table is linked to the
parent query by a unique primary key.

I'm able to detect incomplete subform data using the BeforeUpdate
event on the parent form. But I'm not sure what to do from there.

I'd be very grateful for any help!

Thanks,
Rob
  #2  
Old November 6th, 2009, 08:32 PM posted to microsoft.public.access.forms
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default Required data on subforms

Due to how Access handles data, what's been keyed in the parent form will
be saved before the user starts to key anything on the subform. The only way
to achieve what you're trying to do would be to have logic that deletes the
row from the parent table if nothing's added on either subform. If this is a
single-user application, you could achieve this by writing a Delete query
that deletes any rows in the parent table that have no children, and run
that query when you exit the parent form (or even on the Current event of
the parent form).

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Rob M" wrote in message
...
Hi group,

I have an Access parent form with two subforms. I'm wondering whether
there's a way to "force" people to enter data on one field in each
subform, or else not save any data (parent data included) at all.

If it's relevant, the parent form is supplied by a query. Each
subform is supplied by its own table. Each table is linked to the
parent query by a unique primary key.

I'm able to detect incomplete subform data using the BeforeUpdate
event on the parent form. But I'm not sure what to do from there.

I'd be very grateful for any help!

Thanks,
Rob



  #3  
Old November 6th, 2009, 10:06 PM posted to microsoft.public.access.forms
Rob M[_3_]
external usenet poster
 
Posts: 4
Default Required data on subforms

Thanks Doug. That explains a lot. I think it's back to the drawing
board with this idea...

Cheers,
Rob
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:55 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.