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

Subform headache 1

Status
Not open for further replies.

Griff389

Technical User
Jun 27, 2003
82
GB
I've got a subform which is a continuous form displayed in my main form. The subform contains fields [RetrunNo], [ItemNo] plus a few more insignificant fields. The link field is [ReturnNo]. So far this works fine.

I want to add a second form to display information based on which record is highlighted in the subform. As there is more than one record i'll need to display information based on both [ReturnNo] and [ItemNo].

Can someone point me in the right direction please. If you need more information please let me know.

A screen shot of what i'm trying to do.
purch.jpg



A screen shot of my relationships.
relationship.jpg


Regards

Griff
 
Hallo,

Sounds like you want your subform to contain a subform. That should be quite straightforward. Just do it the same way as you did the first one.

- Frink
 
The problem with that lies in when you try to add a subform to a form that contains a continuous form, as I have, you get the message of:

A form with a subform object can't have it's DefaultView property set to Continuous Forms.

You tried to add a subform to a form in Design view. {name of form} will reset the property to single form.
 
Hallo,

Put a new, unbound ItemNo field on your main form and link your new subform to that and the ReturnNo field.
Then in the OnCurrent event of the continuous subform, copy the item no to the new control.

- Frink
 
Thanks for the help. It certainly looks like a step in the right direction.

I have added an unbound box, got it to update with the item number from the continuous form no problems. :)

Now the problem is how to link the main form and this subform together using two sets of fields. When I go into the properties of the subform and then go into the link fields, and click the builder (i presume that is how you use more than one link field), it doesn't let me choose it as a link field. It doesn't appear in the list. Presumably due to it being an unbound control and not in the physical table.

So I thought i'd add it as a field to the main table, then use it in the link fields builder. But after doing that I couldn't run the form, it kept returning me to design mode when I ran it. If i turn the control back to unbound, I can run the form no problem.
 
Hallo,

You'll have to do it manually, not use the builder.

Use a ; to separate the fields.
The child link should be the names of the returns and item number fields in the underlying recordset.
The master fields should be the names of the returns field and item number control.

- Frink
 
Got it, that works great! Didn't know you could use link fields by typing as oppose to using the builder.

Cheers.

Griff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top