PC Review


Reply
Thread Tools Rate Thread

clear records on subform when go to knew record on main form

 
 
=?Utf-8?B?YmFicw==?=
Guest
Posts: n/a
 
      6th Jul 2007
I am using the unbound combo fields on the main form (date, joblist,
personnel) to populate and schedule fields in a subform when I navigate to a
new record (new day) on the main form. I would like the subform records to
be cleared out for the new record but remain for the day that has already
been scheduled.

What code and where do I put it.

thanks,
barb
 
Reply With Quote
 
 
 
 
J
Guest
Posts: n/a
 
      6th Jul 2007
It should be automatic (no code) if your main form and subform are set
up properly.

Definitions that will make my explanation easier... just sub in your
own names:
FormMain - Your main form
TableMain - The table or recordset underlying your main form
FormSub - Your sub form
TableSub - The table or recordset underyling your sub form

The checklist:
( ) Does TableSub have a field that stores a reference to TableMain's
primary key?
( ) Did you set up a many-to-one relationship between TableSub and
TableMain?
( ) Did you set the "child" and "master" fields properly on the
subform in FormMain?

If all of those are true, then going to a new record on FormMain
should 'clear out' FormSub. Going to a new record is NOT the same
thing as just typing in a new date. Typing in a new date just changes
the record in TableMain you're currently looking at and has no effect
on FormSub or TableSub.

Hope that helps,
~J



On Jul 6, 3:26 pm, babs <b...@discussions.microsoft.com> wrote:
> I am using the unbound combo fields on the main form (date, joblist,
> personnel) to populate and schedule fields in a subform when I navigate to a
> new record (new day) on the main form. I would like the subform records to
> be cleared out for the new record but remain for the day that has already
> been scheduled.
>
> What code and where do I put it.
>
> thanks,
> barb


 
Reply With Quote
 
pietlinden@hotmail.com
Guest
Posts: n/a
 
      7th Jul 2007
On Jul 6, 2:26 pm, babs <b...@discussions.microsoft.com> wrote:
> I am using the unbound combo fields on the main form (date, joblist,
> personnel) to populate and schedule fields in a subform when I navigate to a
> new record (new day) on the main form. I would like the subform records to
> be cleared out for the new record but remain for the day that has already
> been scheduled.
>
> What code and where do I put it.
>
> thanks,
> barb


why not bind the recordsource in the On Change event of one of the
three combobox fields. Limit to the single record, and you should be
fine...

 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      13th Jul 2007
On Fri, 13 Jul 2007 10:19:40 -0700, Jim wrote:

>I'm seeing this problem as well. I've checked off on all three of your points but am still have the same problem. I have stepped through what's going on in the subform when a new record is created in main form and the subform keyfields are set to the same value as whatever prior existing record was last looked at. If I try to force the keyfields on the subform to be the key value from the new record, Access raises an error regarding trying to insert a record and the parent key doesn't exist. I've also noted that the subform(s) are being put into an insert record state when a new record is created on the main form.
>
>Still searching for a solution...
>
>EggHeadCafe.com - .NET Developer Portal of Choice
>http://www.eggheadcafe.com


Jim, it is really helpful when you post a reply to leave at least some
indication of what you are replying TO. There are a lot of messages in this
newsgroup and a lot of different newsreaders and websites...

John W. Vinson [MVP]
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Filter main form to records with no related records in subform,maintain updateable recordset esn Microsoft Access Form Coding 4 3rd Sep 2011 01:07 AM
Scroll records in main form - ignore linked subform records smithy Microsoft Access Form Coding 3 21st Jul 2009 04:46 PM
Records in subform do not change when record in main form changes Ivan Microsoft Access Forms 0 20th May 2009 04:09 PM
moving a main form and subform to a specific subform record =?Utf-8?B?RGF3blRyZWFkZXI=?= Microsoft Access Form Coding 17 27th Nov 2006 06:31 PM
delete record in a main form and any link records in the subform =?Utf-8?B?aG5nbw==?= Microsoft Access Form Coding 5 21st Jul 2005 05:48 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:36 PM.