problem with linking (i think)

mikeder

Member
Local time
Today, 13:56
Joined
Nov 12, 2002
Messages
34
Hi, I'm wondering if there is someone out there who can help me with this:

I have a [Projects] table in my main form that contains project information (i.e. project number, work description, project manager etc). In the main form, I have a subform called [Client] (contains client contact info) which is currently linked to the main form. For example, in the main form, if I select a project file, it will automatically bring up the corresponding [Client] information in the subform. This currently works great. The [Client] table has a unique ID (auto number field) called Client_ID an this is linked to a corresponding Client_ID field in the projects table.

Here is my problem.

For existing projects, I can update [Client] information easily because each time I select a project file number in the main form, the corresponding [Client] information is displayed in the subform. The problem is this: If I enter a new project file number, for an existing client it does not know how to reference one of the existing clients in the table. e.g. If I want to enter a new project for an existing client, I will have also create an identical instance of that client. How do I do it so that when I create a new project for an existing client, it will reference that existing client?


Thanks in advance
 
Your Projects table needs to include a CustomerID field which will function as the foreign key to the Customer table. Add a combo to your Projects form that will allow the user to select the appropriate Customer.
 
another question

thanks for your reply.

My Projects table already contains a Client_ID field. Are you suggesting that I insert a combo box in the main form [Projects] with data from the Client_ID field? How do I do it so that when I select from this combo box in the main form [Projects], that the appropriate Client details will be in the client subform?

Thanks again
 
You need to set the master/child links so that Access can synchronize the main and subforms. Click once on the subform to select it and then open its property sheet to set the links.
 

Users who are viewing this thread

Back
Top Bottom