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

Subform Question

Status
Not open for further replies.

Dlynn

IS-IT--Management
Apr 17, 2001
12
US
I have a form & a subform, is there anyway that when I am entering data in my subform, I don't have to enter data to the form.

For example..

I have a database that has a customers name address & account number, phones etc. In the subform I just want to add customer notes. I have the 2 forms linked by the account number field. Currently, when I add notes to the subform I have to also add data to the main form which I don't want to do because I want the data in the main form to be the same, just the notes form will change.

HELPPPPPPPPP
 
If you want a subform to link to the main form it needs a Unique ID of some sort.
So if you have a main form and you want to add notes in a sub form then the subform has to have one field which it the same as the main form such as Customer Id or Invoice number.
Otherwise the is no link between the two.
And when you are on a particular record in the main form the subform should automatically put that Unique ID in the subform for you then you type in the second field called Notes.

This is done in the properties of the subfrom “Child/Master Links”

You can of course make the key field in the subform In-visible so it won’t show.

DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
DougP,

I have 1 field in common in both forms. I don't see where the child/master links go undere the properties of the subform, I looked & can't find that under properties
 
Dlynn
I think your child/master link may be the problem as far as not being able to independantly update the form/subform. Try this -
STEP ONE; delete the child/master link in the properties of the master form.
STEP TWO; create an unbound field in the subform and set the default source for this field for this as being =forms!mainform!link - 'link' being the customerID or invoice field in your main form. (If you have no wish for this unbound field to be visible in the subform - then alter the properties for the field, but leave the field enabled .. or simply reduce its size, and right-click to recolour to background colour of form. IE hide it from the user. You are best also to lock the field and mark the tabstop - as 'no').
STEP THREE; Find in the subform properties what the recordsource query is, (then click on '...' to open query design) and add search criteria on the customerID or invoice column/row intersection as being =[forms]![mainform]![subform]![field]. (If the column isn't in query then add it from the appropriate table in query). Make sure that you copy and paste this extra search condition to every row within the query.

By doing this - you should find that you are able to now update the notes in the subform field without having to touch the field content in the main form.

Hope this helps - I think I've covered everything!

Regards

Phil
 
Dlynn
..forgot to mention about the subform child/master link. As you rightly say, you won't find this on the subform itself .. only on selecting the frame in which the subform sits within the main form.
Phil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top