Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help on sub forms problem!!!

Status
Not open for further replies.

RickBerem

Programmer
Jan 18, 2001
156
CA
Hello,

I've got a little problem with my sub form... it's linked to the primary key of my PRODUCTION table it shows the DOWNTIMES of this production but when I create a new Prodcution the sub forms still shows the previous production's downtime witch leads to confusion...

any help would be usefull

Thanks
Rick
 
Look at the main form's properties. I'll bet your Master Link Fields and Child Link Fields properties are blank. These properties are what keep the master and subform synchronized. You need to set them to the name of the field (or fields) that you use to match Production table rows to Downtimes table rows. See the help docs for more information on these properties. Rick Sprague
 
Hmmmm....

These 2 properties are correctly filled... if you have another option could be usefull.

Thanks
Rick
 
OK, sorry I jumped to a conclusion.

How are you "creating a new production"? By clicking the >* navigation button or the equivalent menu command? Is there any code that runs at Before Insert or Current events? Is there any code in the subform that tinkers with its Bookmark property?

What are the keys of the Production and Downtime tables? What field(s) relates them? Is that field on both main form and subform? If not, which? Rick Sprague
 
Ok...


I create a new production with the >* button
there's no code running at before insert but at
current of the subform I requery combo box(combobox.requery)
no code touch the bookmark

the 2 tables are linked together by the primary key of table production
as PK_Production(table Production)---->Production(table downtime)

this field is only on the main form.

is that of any help?

and btw thanks for your time ;)
Rick
 
I'm totally stumped. Everything sounds like it ought to. All I can think of is for you to describe everything about the tables, forms, and controls and let me try to build the same thing and see if I can reproduce the problem.

I need:
Table names
Field names and datatypes
Form names and record sources
Control names, types, and control sources
For list and combo boxes, rwo source type and row source
Exact steps to reproduce the effect.

Sorry to have to go through this laborious process. If anybody else is following this thread and has anything to offer,please feel free to jump in! Rick Sprague
 
Is the subform bound directly to the Downtime table or is it bound to a query that was previously built(i.e. prior to creating the form) on the Downtime table? If so, you need to make sure the foreign key is in the query(it doesn't have to be on the subform, just part of the underlying recordset). You should also make sure that your relationships are set correctly in the relationship view. This sounds like a case where you should enforce referential integrity and cascading updates/deletes.
 
ok Jerry, I checked all you said and there's no query
I used the wizard to build my subform control...
the relationship are enforced with cascade and deletes checked...

RickSpr, it's very nice of you to help me like that
well... let's see. I don't want you to rebuild everything
maybe I could send you a smaller copy of my work with the steps so you could check it out.
There's only a little problem, you'll need to know a little french to understand everything I wrote. Yeah, I know I shouldn't make my work in french but it's easier for the people I work for. Well If you're willing just send me our e-mail in your next post and i'll send you a copy.

Thanks
RickBerem
 
Sorry RickSpr,

I found my problem... it was a code line in my combobox that requeried the subform and the seubform used old values(I guess) so I ended up with the previous record of Downtime...

thanks for your time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top