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!

Using an the ID number from the data in the main form, in a subform

Status
Not open for further replies.

HDuke

Programmer
Mar 29, 2003
2
GB
Hi, I appologise if this problem has been poseted somewhere else already but I'm not sure what to search for to find the answer.

My database is for a tourism centre who want to record visitors and their interests.

I have 3 tables 'Visitors', 'Interests' and VisitorInterest. I have a form for entering visitor information and I want to have a subform to enter interest categories for that visitor, I have a form with a dropdown list of all available interests and a 'New Interest' button going to a new record but it doesn't want to work. I think its because it doesn't recognise the VisitorID number from the main form. I have been pondering this for about a week and still not found the answer.

- A very lost Database Programmer -
 
Hi
For your subform to recognise the Visitor ID.
Open the parent form in design View
Click on the subform control
In the Data page of the properties sheet,
set Link Master Fields to Visitor ID
set Link Child Fields to the relevant field in the VisitorInterests table (your subform should be based on this table)

A wizard would help you do this when creating the subform.

Also, you should set relatioships as below
-Link VisitorID in Visitors table to relevant Field in VisitorInterests Table
-Link InterestID in Interests table to relevant Field in VisitorInterests Table

OwenTech
 
Thanks a lot :) This has led to a new problem however. I displays the outline of the subform (ie where the subform should be) but there is nothing in it. I have tried changing the format properties on the forms but no luck.

Any suggestions?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top