当我运行我的代码时,程序找不到对我的字段的引用。我怎样才能解决这个问题? 没有参考的字段是"我![SetupMenuID]。"
Dim con As Object
Dim rs As Object
Dim stSql As String
On Error GoTo SetupButtonClick_Err
' Find the item in the Switchboard Items table
' that corresponds to the button that was clicked.
Set con = Application.CurrentProject.Connection
Set rs = CreateObject("ADODB.Recordset")
stSql = "SELECT * FROM [Setup Sheet Items] "
stSql = stSql & "WHERE [SetupMenuID]=" & Me![SetupMenuID] & " AND [SetupItemNumber]=" & numBtn
rs.Open stSql, con, 1 ' 1 = adOpenKeyset