我有以下代码行导致运行时错误“3061”;参数太少。我确定错误是由于数字变量周围的语法,但我尝试了几个不同的引用和括号的安排没有运气。
Private Function ChangeWorkCenterAll(rId As Integer, newUserId As Integer, sId As Integer)
Dim rs As DAO.Recordset
Dim q As String
q = "SELECT * FROM Schedules INNER JOIN Activities ON Schedules.ActivityId = Activities.ActivityId WHERE (Activities.RoleId = " & rId & " AND ShopOrders.ShopOrderId = " & sId & ");"
Set rs = CurrentDb.OpenRecordset(q, dbOpenDynaset)