newbie needs help simple form

E

espee2

I'm making a simple inventory database with basically Categories,
Products, Mailing list as my tables. I have a form with category as
main, products as a sub form. with relationship between them as 1 to
many (1 cat to many products)

I want to create a form with Mailing list as main and products as the
subform so I can enter a customers name..etc. with the products they
bought from the products subform. I have a relationship between the
two as 1 to many (1 mailing to many products) It comes out ok using
the wizard then but the products sub-form is empty (not showing the
data already entered into the products form/table.
 
K

Karl Hoaglund

Hi espee2.

The first thing you want to check with a main form/subform situation is that
the link fields are set correctly. The wizard makes a guess how these should
be set, and does a pretty good job of getting it right--but doesn't always.

Go into your main form in design mode and single-click on the subform control.
Open the Properties window if it isn't open already. Make sure you have the
subform control selected. If you do, the title of the Property Window will
begin with "Subform. . . .".

Click the Data tab. The second and third properties are "Link Child Fields"
and "Link Master Fields".

The Link Master Fields should be the field or fields on the main form that
uniquely identify the main record. (This is the "one" record in the
one-to-many relationship you mentioned. It is usually easiest and most
efficient to use a single RecordID field for this, an autonumber field, but you
don't have to. You could have multiple fields to indentify the main record; if
so, enter all the field names separated by semi-colons.

The Link Child Fields are the fields in the child (subform) record that match
with the ones in the Master form. Typically, if there is a RecordID field in
the master record, it will correspond to something like a ParentID field in the
child record. Enter the appropriate field(s) from the child record in the Link
Child Fields property.

I'm guessing that adjusting these will probably make your records show up.

I notice that you have a Products subform in both of the forms you are
creating. You can save yourself some work by using the same form in both
places, if one form design will handle both contexts.

Let me know if this solves your problem.

Karl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top