我想分配一個SQL查詢的結果使用Access中的VBA變量。查詢返回一個值,但分配給它的變量的值爲Nothing。這裏是代碼片段:SQL查詢返回值後記錄集=沒有什麼
Dim queryReturnID As String
queryReturnID = "select dbo_tbl_SupplierReturn.ReturnID from dbo_tbl_SupplierReturn" & _
" where SupplierID = " & lstPOHdr.Column(1)
Debug.Print queryReturnID
Dim RecordSet1 As DAO.RecordSet
Set RecordSet1 = CurrentDb.OpenRecordset(queryReturnID)
queryReturnID返回什麼? – Brad