HELP! I'm about to demonstrate my application to some people and all of the sudden its not working.
In the afterUpdate event, I'm selecting item_total from a table and everytime I run this event, I get an error
Runtime Error 3021 no current record. But I check my table and the data is there and the item no/quote no in the where statement match what is in my table. What could I be doing wrong?
Dim DB As DAO.Database
Dim rstSum As DAO.Recordset
Dim strSQL As String
Dim intTotal As Double
Dim strPriceDescription As String
Dim intOldItemTotal As Currency
Dim intNewItemTotal As Currency
Dim intGrandTotal As Currency
Dim intTradeIn As Double
Dim intDiscounts As Double
Dim intTraining As Double
Dim intOther As Double
Dim strQuoteNo As String
If Nz(Me.Item_No) = "" Then
GoTo Exit_Price_AfterUpdate
End If
intOldItemTotal = 0
intNewItemTotal = 0
intGrandTotal = 0
intTradeIn = 0
intDiscounts = 0
intTraining = 0
intOther = 0
Set DB = CurrentDb()
'Get Item Total Before Price Change
strSQL = "SELECT Item_Total FROM tbl_Quote_Equipment " & _
"WHERE QuoteNo = '" & strQuoteNo & "' and Item_No = '" & Me.Item_No & "';"
Set rstSum = DB.OpenRecordset(strSQL, dbOpenDynaset)
intTradeIn = Forms!frm_Opportunity_Quot
e.Trade_In
_Amount
intDiscounts = Forms!frm_Opportunity_Quot
e.Discount
s_Amt
intTraining = Forms!frm_Opportunity_Quot
e.Training
_Amt
intOther = Forms!frm_Opportunity_Quot
e.Other_Am
t
strQuoteNo = Forms!frm_Opportunity_Quot
e.txtQuote
No
intOldItemTotal = rstSum!Item_Total
Start Free Trial