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

Subforms for Access 97

Status
Not open for further replies.

maxbn

Technical User
Oct 25, 2004
6
US
I built a database with two subforms. The first Subform works fine, but the second subform is not. The subforms are running off a query and the second subform is taking the first line of the query and adding it to the result on the second subform. I can not figure out why.
 
I don't understand what you are referring to when you say

"the second subform is taking the first line of the query and adding it to the result on the second subform."

can you rephrase it so that I can offer some assistance?

Frank J Hill
FHS Services Ltd.
frank@fhsservices.co.uk
 
The top subform I can look up by a Book ISBN and it provides the information that is in the query. The second subform, I use to pull a group of data based on an internal number. When I pull by the internal number on the second subform, the first line of this subform does not belong to this internal number group. It appears that the second subform is pulling the line item from the first subform and changes it to reflect the name and number of the internal group that I looked up.
 
Have you had a look at the Parent/Child entries in the subform properties page.
Both subforms should have the same ie: BookISDN

Also I would use a second query for the second subform or the straight SQL for each subform.

Frank J Hill
FHS Services Ltd.
frank@fhsservices.co.uk
 
Thanks for helping with this. Can you explain more about the parent/child entries. I am not sure what this means.
 
The subform id the child og the Parent - the main form.

in design view when you look at the properties page of the subform there will be entries of:
Link Child Fileds and Link Master Fields (3 rows from the top of the page)
These entries set up the data relationship between the forms in just the same way that the primary key and foreign key of two tables set their relationship.
The relationship (Link Fields) for your forms appears to be 'BookISDN' but I suspect that for the second subform it is actually 'internal number'

Frank J Hill
FHS Services Ltd.
frank@fhsservices.co.uk
 
I removed the second subform to see if the problem was that subform but there appears to be a problem with the first subform as well. I looked at the parent/child fields and they are the same in both entries. When I enter the BookISBN and hit enter, this BookISBN I entered is overriding (it appears) the BookISBN directly below it in the query and replacing it with the BookISBN I just entered. I am very confused.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top