0

I have a dropdown combo box in a form for a "Project_ID" called: Combo28 (this is the primary key basically). There are also 5 other "Error_Code" combo boxes called: cboErrCod1, cboErrCod2, cboErrCod3, cboErrCod4, cboErrCod5.

I'm looking to create some sort of "On Change" code that will only display the Error Codes pertaining to the Project_ID selected in the Combo box "Combo28" only.

The error codes are stored in a separate table and each code is associate to a particular project_Id.

Can anyone help?

4

1 回答 1

1

我不确定为什么你有五个错误代码组合框。要轻松完成此操作并让 access 为您完成所有工作,您可以:

答:有一个包含 project_ID 下拉列表的父表单。创建子表单(连续表单视图)。将记录源设置为您的错误代码和Link to Master using Project_ID

B:使用记录源创建一个子表单,"Select ErrorCodes from yourTable WHERE Project_ID = [Forms]![yourForm]![combo28] 其中 combo28 是您的 project_ID。在您的组合框的更新后事件中,调用.requery并且可能.refresh在您的子窗体上。

于 2013-04-08T19:24:20.547 回答