如何測試記錄集是否爲空?訪問VBA:如何測試recordSet是否爲空?一片空白?
Dim temp_rst1 As Recordset
Dim temp_rst2 As Recordset
Set temp_rst1 = db.OpenRecordset("SELECT * FROM ORDER_DATA WHERE SKUS_ORDERED = '" & curSKU1 & "' AND [ORDER] = " & curOrder)
Set temp_rst2 = db.OpenRecordset("SELECT * FROM ORDER_DATA WHERE SKUS_ORDERED = '" & curSKU2 & "' AND [ORDER] = " & curOrder)
If IsNull(temp_rst1) Or IsNull(temp_rst2) Then MsgBox "null"
我打開了幾個基於select語句的記錄集。如果沒有記錄,IsNull是否會返回true?
如果您的問題被回答,請記得要好好檢查你首選通過單擊對答案的左側的綠色對號使用的答案。 –