Advertisement

06.08.2007 at 06:17AM PDT, ID: 22621637
[x]
Attachment Details

Access VBA Runtime Error 3021 No Current Record

Asked by Marilync1266 in Access Coding/Macros, Microsoft Access Database

Tags: error, current, 3021, access, record

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_Quote.Trade_In_Amount
intDiscounts = Forms!frm_Opportunity_Quote.Discounts_Amt
intTraining = Forms!frm_Opportunity_Quote.Training_Amt
intOther = Forms!frm_Opportunity_Quote.Other_Amt
strQuoteNo = Forms!frm_Opportunity_Quote.txtQuoteNo
intOldItemTotal = rstSum!Item_TotalStart Free Trial
 
 
[+][-]06.08.2007 at 06:25AM PDT, ID: 19241706

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.08.2007 at 06:26AM PDT, ID: 19241719

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.08.2007 at 06:28AM PDT, ID: 19241728

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Access Coding/Macros, Microsoft Access Database
Tags: error, current, 3021, access, record
Sign Up Now!
Solution Provided By: capricorn1
Participating Experts: 3
Solution Grade: A
 
 
[+][-]06.08.2007 at 06:28AM PDT, ID: 19241737

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.08.2007 at 06:30AM PDT, ID: 19241752

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.08.2007 at 06:34AM PDT, ID: 19241796

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.08.2007 at 06:37AM PDT, ID: 19241823

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.08.2007 at 06:38AM PDT, ID: 19241827

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.08.2007 at 06:40AM PDT, ID: 19241842

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.06.2007 at 05:45PM PDT, ID: 19435971

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]07.11.2007 at 09:33PM PDT, ID: 19468873

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32