Hello,
I need help... I am working on my project and I have been getting this error message (run-time error ‘3265’ item not found in this collection) when I click on the debug it highlight this code:
[highlight] Set rstItem_Price = db.Recordsets(strSQL)[/highlight]
If some one can tell me how to can fix the code
this is the code i am working on:
Private Sub cmdCart_Click()
Dim db As DAO.Database
Set db = CurrentDb
Dim curItem_PricePrice As Currency
Dim curDiscountRate As Currency
Dim curDiscountTotal As Currency
Dim curSalesTax As Currency
Dim strSQL As String
strSQL = " SELECT * FROM tblItem WHERE Item_Price = """ & CStr(cboItem.Value) & """"
Dim rstItem_Price As DAO.Recordset 'get product price
Dim rstDetail As DAO.Recordset 'create order detail
Dim rstorderid As DAO.Recordset 'update shopping cart
'get price and discount rate of product
[highlight]Set rstItem_Price = db.Recordsets(strSQL)[/highlight]
With rstItem_Price
.Edit
curItem_Price = !Item_Price
.Update
End With
'create order detail
Set rstDetail = db![order details].OpenRecordset
With rstDetail
.AddNew
!Item_ID = cboItem.Value
!Ord_ID = mintorderid
!Item_Price = curProductPrice
End With
End Sub
I need help... I am working on my project and I have been getting this error message (run-time error ‘3265’ item not found in this collection) when I click on the debug it highlight this code:
[highlight] Set rstItem_Price = db.Recordsets(strSQL)[/highlight]
If some one can tell me how to can fix the code
this is the code i am working on:
Private Sub cmdCart_Click()
Dim db As DAO.Database
Set db = CurrentDb
Dim curItem_PricePrice As Currency
Dim curDiscountRate As Currency
Dim curDiscountTotal As Currency
Dim curSalesTax As Currency
Dim strSQL As String
strSQL = " SELECT * FROM tblItem WHERE Item_Price = """ & CStr(cboItem.Value) & """"
Dim rstItem_Price As DAO.Recordset 'get product price
Dim rstDetail As DAO.Recordset 'create order detail
Dim rstorderid As DAO.Recordset 'update shopping cart
'get price and discount rate of product
[highlight]Set rstItem_Price = db.Recordsets(strSQL)[/highlight]
With rstItem_Price
.Edit
curItem_Price = !Item_Price
.Update
End With
'create order detail
Set rstDetail = db![order details].OpenRecordset
With rstDetail
.AddNew
!Item_ID = cboItem.Value
!Ord_ID = mintorderid
!Item_Price = curProductPrice
End With
End Sub