在 Microsoft Access 中使用两种形式将参数从一个组合框传递到另一个组合框

Pass parameters from one combo box to another using two forms in Microsoft Access

刚开始为我正在进行的项目使用 Access 2016。

如何将 selected 数据从一种形式传递到另一种形式?

该选择将决定下拉菜单中显示哪些数据。基本上,如果我 select 一个部门,我希望该部门的数据成为下一个 "select from" 数据。

我不确定这是否是一个明确的问题,所以我添加了图片。

目标是不必为每个部门创建新表格。

Update:

So I am able to link the department combo box with the lineid box with the following Query

SELECT DISTINCT Line.lineName, Department.departmentName
 FROM Line INNER JOIN Department ON Line.departmentID = Department.departmentID
 WHERE (((Department.departmentName)=[Forms]![Production_Select_Data_Input_Destination].[OpenArgs]));

I need to get the parameter passed so this is not prompt and the combo box for lineId loads a select list of lineId's that are within the selected department.

我用

弄明白了
Private Sub btnEnterDataInput_Click()

 DoCmd.OpenForm "frmDataInput", , , , , , OpenArgs:=cboDepartmentName

End Sub

在我的第一个表格中, 和

[Forms]![frmSelectDataInput]![cboDepartmentName]

在我的第二个表单组合框行源查询中。

在我的第二种形式中。