Problem with subforms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all

I created a main and subform with a formwizard with data from two tables. For example as a main form a contactperson with a linked subform with his adress(es). The problem lies within data-entry: when i enter new data in de contactperson form automatically a new contactpersonID is created. But when i click the linkbutton (togglelink) and insert, in de linked subform, some adress data, the foreign key (contactperson) isn't filled in automatically, it isn't even recognized. The same counts for adding new adress to an existing contactperson(ID): in the (filtered) subform the foreign key in the table is still zero. So one: the linkbutton to the subform doesn't save new records in the main form and two: the foreign key isnt automitacally updated.

I find this strange because when i use the same formwizard but instead create a main form with a nested subform then it works fine. I checked my relations between the tabels contacperson and adresses: They are one-to-many linked via ContactpersonsID integrity and all casacede options on. Can anyone help me with this problem, i dont have visual basic experience so i hope there is an alternative.

Greetings Tim
 
Tim,

Have a look at the properties of the subform control on the main form.
Look at the Link Master Fields and Link Child Fields properties... do
they show the correct entries? (I think it would be ContactPersonID for
each. but the information in your post is a bit contradictory on this.)
 
thans for your reaction

I cannot find these parent/child field properties nowhere in objects of the mainform. The only object on the mainform that refers to the subform is the togglelink. The formwizard created this one autmatically.

When i insert a subform manually in the desigview of the main form, then i can set the parent/child relationship (in my case both contactpersonID). Then all linked fields for that selection are automatically filled in properly. But then i have a nested subform. And what i want is to access this subform via a button


----- Steve Schapel wrote: ----

Tim

Have a look at the properties of the subform control on the main form.
Look at the Link Master Fields and Link Child Fields properties... do
they show the correct entries? (I think it would be ContactPersonID for
each. but the information in your post is a bit contradictory on this.
 
Tim,

Link Master Fields and Link Child Fields are properties of a subform
control. In design view of the main form, select the subfrom and open
the Properties sheet. The settings of these properties is what
determines the relationship between a main form and a subform, and it
has to be correctly set up for the subfrom to work properly. I suggest
you put your cursor in the box for one of these properties in the
property sheet, and press F1 to read the Help topics.

What is a togglelink? And what does it do?
 
Back
Top