我正在尝试通过单击按钮将 ComboBox 中的名称从一种形式传递到另一种形式,但我似乎无法使其正常工作。我不习惯使用 MS Access,我相信它是一个简单的答案。这是我到目前为止所拥有的:
表格 A:
Private Sub Command104_Click()
On Error GoTo Err_Command104_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Vol_Hrs"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Forms.Vol_Hours.Search.Value = Me.Combo94.Column(0)
Exit_Command104_Click:
Exit Sub
Err_Command104_Click:
MsgBox Err.Description
Resume Exit_Command104_Click
End Sub
表格 B:
Private Sub cmdAddNew_Click()
On Error GoTo Err_cmdAddNew_Click
Dim stDocName As String
Dim stLinkCriteria As String
DoCmd.Close
stDocName = "frmLookupScreen"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Forms.frmLookupScreen.Combo94.Value = Me.Search.Column(0)
Exit_cmdAddNew_Click:
Exit Sub
Err_cmdAddNew_Click:
MsgBox Err.Description
Resume Exit_cmdAddNew_Click
End Sub