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

Form created from multiple tables (needs to update and review)

Status
Not open for further replies.

Valeriya

MIS
Jan 9, 2006
138
0
0
US
Hi Guys!
I've created a form from multiple tables...
One table is a multifield (central table), the otheres are a single field tables that are populated with data such as say - certaine codes for business transactions...
On the form there are combo boxes that pull their info from these tables plus there are objects on the form that pull data from the center table. It is done so user, when working with the form, does not key in the wrong codes.
The fields that these single record tables have are also present in the central table. I have made the single record of those tables as primary key...Now when I try to add a new record to the form it gives me an error status as:

"Can not add record(s);Join key of table"CenterTable" is not in the recordset"

I realize that I have to somehow specify that the new record data from combo boxes needs to be directed to the specific field in the center table...not sure how it is done...All I get when trying to add new records is the above error.

Thanks much!

Valeriya


Form Record Source
Code:
SELECT [ImpactedFunctions].[IMPACTED_FUNCTIONS], [PriorityCodes].[Priority Code], [ProjectType].[Project Type], [StatusCodes].[StatusCodes], [SupplyChainProjectList].[Project #], [SupplyChainProjectList].[Project Name], [SupplyChainProjectList].[Scope], [SupplyChainProjectList].[Project Lead], [SupplyChainProjectList].[Project Team], [SupplyChainProjectList].[Requestor], [SupplyChainProjectList].[StartDate], [SupplyChainProjectList].[DueDate], [SupplyChainProjectList].[CompletionDate], [SupplyChainProjectList].[Comments]
FROM StatusCodes INNER JOIN (ProjectType INNER JOIN (PriorityCodes INNER JOIN (ImpactedFunctions INNER JOIN SupplyChainProjectList ON [ImpactedFunctions].[IMPACTED_FUNCTIONS]=[SupplyChainProjectList].[Impacted Function]) ON [PriorityCodes].[Priority Code]=[SupplyChainProjectList].[Priority]) ON [ProjectType].[Project Type]=[SupplyChainProjectList].[Type]) ON [StatusCodes].[StatusCodes]=[SupplyChainProjectList].[Status];
 
I don't think you can add record in a Form inviroment.
Best to creat subForm from other table, and then add data.
 
Hi, Guys!
Thanks for answer!
Here is my next problem. I have a combo box on the form called "Project Type". It pulls data from table Project_Type. When I click on the Proect Type Combo box it shows 3 choices for the types. I select one of the choices and want it to update a field in SupplyChainProjectList that has a filed called "Type"...To accomplish that I have written the below procedure, however, when I click add record/save on the form it gives me an error, something like - "can't find a table/fild to save data to....


Code:
Option Compare Database
Option Explicit

Private Sub Combo40_AfterUpdate()
[SupplyChainProjectList].[Type] = Me.[Project Type]
End Sub

Thank you for you kind help!

Valeriya.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top