我在Access 2000中绑定了一个表格。当您打开此表单时,所有文本框和下拉列表都可以正常工作。我有一个组合框,用户可以选择一个选项。根据选择的内容,运行查询。当我这样做时,所有链接到表中的assign字段的文本框工作正常但只有一个。我甚至试图按顺序分配它。我收到错误#Name?。我知道这意味着没有找到它,但为什么。任何帮助,将不胜感激。下面是我的代码,我以编程方式运行查询,并获得错误的屏幕截图。
Public Sub Select_Table(LineNumber As Integer, kvaNumber As Integer)
Dim strlineNumber As String
Select Case LineNumber
Case 0
strlineNumber = "52"
Case 1
strlineNumber = "53"
Case 2
strlineNumber = "54"
Case 3
strlineNumber = "55"
End Select
Dim message As Integer
Dim param As String
Select Case kvaNumber
Case 0
txt_DesignEngineer.ControlSource = "Design_Engineer_2"
Me.RecordSource = "SELECT [Sequence Number], [Design_Engineer_2], [ED Plan Start], [ED Plan Finish], [Prel Person], [Prel Plan Start], [Prel Plan Finish], [Catalog No], [Internal Designer], [Int Plan Start], [Int Plan Finish], [External Designer], [Ext Plan Start], [Ext Plan Finish], [OTL Plan Start], [OTL Plan Finish], [Control Engineer], [Cnl Plan Start], [Cnl Plan Finish] FROM [Engineering Schedule 2] WHERE [Catalog No] LIKE '" & strlineNumber & "03*' ORDER BY [Sequence Number]"
Case 1
End Select
End Sub