1

这是我的桌子

Proposal
--------------
Id | ProposalNo

SalesCall
---------------
Id

SalesCallReference (Junction Table)
---------------
Id | ProposalID | SalesCallID

销售电话可以与许多提案相关

因此,在我的销售电话表单中,我得到了一个连续的子表单,其中包含proposalNo. 有一个组合框可以显示并选择要链接的提案否。

但是当我选择一个新提案时,MS-Access 会为提案创建一个新 ID,而不是salesCallReference.id

因此它创建了新的空提案。

如何仅更新联结表SalesCallReference以及为什么 MS ACCESS 在我添加提案时为提案创建新 ID?

子表单中的组合框有 2 列,theproposalNoProposalId. 我试图proposalId在组合框的单击事件上更新隐藏的文本框,但没有运气。

如果有帮助,这是我加载子表单的查询

SELECT Proposals.ProposalID, Proposals.ProposalNo, SalesCallReference.ProposalID, SalesCallReference.ID, SalesCallReference.SalesCallID AS ReferenceSalesID
FROM Proposals 
   INNER JOIN SalesCallReference ON Proposals.ProposalID = SalesCallReference.ProposalID;

谢谢

4

1 回答 1

2

It sounds like the main form uses SalesCall (or a query based on SalesCall) as its record source. In that case, use SalesCallReference as the subform record source and set link master field to SalesCall.Id and link child field to SalesCallReference.SalesCallID. That way new subform rows will "inherit" their SalesCallID values from the parent form.

Use a combo or list box for ProposalID in the subform.

于 2013-04-30T18:14:56.330 回答