Dim rs As DAO.Recordset
sSQL = "SELECT Stock, Scanned FROM Products&
WHERE ((([Stock])=Forms!Products![StockCode]))
And ((([Scanned])=Forms!Products![Scanned Information]));"
Set rs = CurrentDb.OpenRecordset(sSQL)
If rs.RecordCount = 0 Then
MsgBox "This is not correct"
Else
MsgBox "wooooo this works"
End If
我知道我的 SQL 查询是错误的,但我不确定如何正确地构造它并且我不断收到错误。我是否想用更多的引号将其Forms!Products![StockCode]
分开并将逗号放在外面?