We are in process of upgrading our access XP database to Access 2010. I am testing this one database and getting Runtime error 13 “Type mismatch” when trying to open the form. The error is at "Set varRecSet = dbs.OpenRecordset(strPayQuery)"
“strPayQuery = "SELECT Sum(SYSADM_PAYABLE_LINE.AMOUNT) AS MATERIAL " & _
"FROM SYSADM_PAYABLE LEFT JOIN SYSADM_PAYABLE_LINE ON " & _
"SYSADM_PAYABLE.VOUCHER_ID = SYSADM_PAYABLE_LINE.VOUCHER_ID " & _
"WHERE (((SYSADM_PAYABLE.PAY_STATUS)<>'X') AND ((SYSADM_PAYABLE_LINE.WORKORDER_TYPE)='W') " & _
"AND ((SYSADM_PAYABLE_LINE.WORKORDER_BASE_ID)='" & strSpecNo & "') AND " & _
"((SYSADM_PAYABLE_LINE.WORKORDER_LOT_ID)='SPC'));"
Set dbs = CurrentDb
Set varRecSet = dbs.OpenRecordset(strPayQuery)
The weird thing is, if I open the same form in Access 2010 without converting database to access 2010 format, its work fine. Also works fine in Access XP.
Any suggestions???
Thanks.
“strPayQuery = "SELECT Sum(SYSADM_PAYABLE_LINE.AMOUNT) AS MATERIAL " & _
"FROM SYSADM_PAYABLE LEFT JOIN SYSADM_PAYABLE_LINE ON " & _
"SYSADM_PAYABLE.VOUCHER_ID = SYSADM_PAYABLE_LINE.VOUCHER_ID " & _
"WHERE (((SYSADM_PAYABLE.PAY_STATUS)<>'X') AND ((SYSADM_PAYABLE_LINE.WORKORDER_TYPE)='W') " & _
"AND ((SYSADM_PAYABLE_LINE.WORKORDER_BASE_ID)='" & strSpecNo & "') AND " & _
"((SYSADM_PAYABLE_LINE.WORKORDER_LOT_ID)='SPC'));"
Set dbs = CurrentDb
Set varRecSet = dbs.OpenRecordset(strPayQuery)
The weird thing is, if I open the same form in Access 2010 without converting database to access 2010 format, its work fine. Also works fine in Access XP.
Any suggestions???
Thanks.