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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NewRecord Issue in Subform

Status
Not open for further replies.

georgesOne

Technical User
Jul 2, 2004
176
JP
Good Morning,

I have a form ('frm_Compounds') with two subforms ('fSubSpec1' and 'fSubSpec2') both subs having the same recordsource.
fSubSpec1 has a child/master relation to the main form, while fSubSpec2 shows data which could be shown also with fSubSpec1, but for GUI reasons, I decided two separate forms. fSubSpec1 has navigationbuttons, fSubSpec2 not.
To make sure that fSubSpec1 and fSubSpecs2 are in sync, fSubSpec1 has the following Load and OnCurrent events:

Code:
 Set rfrm = Forms!frm_Compounds.fSubSpec2.Form
  sSQL = "Select * from ztbl_CompoundLots Where ztbl_CompoundLots.LotID = " & Forms! ztbl_Compounds.fSubSpec1.Form.LotID
  rfrm.RecordSource = sSQL
  rfrm.Requery

That works fine for existing records, but if I go to a new record with on either the main form or on fSubSpec1, then fSubSpec2 does not discplay a new record... how can I do that?

Thanks, georges
 
How are ya georgesOne . . .

Since you already have [blue]frmSpec1[/blue] synchronized to the main form via [blue]Link Master/Child[/blue] properties, I see no need to modify the recordsource of [blue]frmSpec1[/blue] ... which should be [blue]sSQL = "SELECT * from ztbl_CompoundLots;"[/blue].

[blue]frmSpec2[/blue] should be in sync with [blue]frmSpec1[/blue] via [blue]Link Master/Child[/blue] properties, as it appears [blue]frmSpec1[/blue] and [blue]frmSpec2[/blue] nedd to be related in a [blue]one to one[/blue] manner.

Link Master Fields: Forms!MainFormName!frmSpec1!PKname
Link Child Field : PKname

Your Thoughts . . .

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top