Runtime Error 3420 on a Database RRS feed

  • Question

  • Hi Everyone, 

    I work as a Access Developer, I'm trying to figure out the runtime error 3420, it comes everytime I open the database.
    The following code is on 'Auto Ex' process.

    Public Function ProcessEventEndCheckAll(ProcessedInv As Boolean, ProcessEventEndDt As Boolean, EventID As Integer, EventEndDt As Date, DeliveryDt As Date)
    Dim db As DAO.Database
    Dim currDate As Date
    Dim Id As Integer
    Dim RS As DAO.Recordset
    Dim rs2 As DAO.Recordset

    DoCmd.SetWarnings False
    Set db = CurrentDb

    Id = [EventID]
    currDate = Date
    Set rs2 = Form_frmMainEvents.Recordset

    Do While Not rs2.EOF
        Id = rs2!EventID
        ProcessedInv = rs2!ProcessedInv
        ProcessEventEndDt = rs2!ProcessEventEndDt
        EventEndDt = rs2!EventEndDt
       ' MsgBox "INner Loop" & EventEndDt & currDate & Id, vbInformation
       'if the event is over but the inventory is not put back, the loop in run
        If (DateDiff("d", EventEndDt, currDate) > 0) And ProcessedInv = True And ProcessEventEndDt = False Then
           ' MsgBox "INnermost Loop" & EventEndDt & currDate & Id, vbInformation
            cntr = 0
            Set RS = Form_frmMainEvents.SubformEventDetails.Form.Recordset
            Do While Not RS.EOF
           '  MsgBox "INnermost Loop" & EventEndDt & currDate & Id, vbInformation
                Q1 = Form_frmMainEvents![SubformEventDetails].Form![quantity]
                colName1 = Form_frmMainEvents![SubformEventDetails].Form![Item_Name]
                Lcntr = DateDiff("d", rs2!DeliveryDt, rs2!EventEndDt) + 1
                For cntr = 0 To Lcntr - 1
                    invDate = DateAdd("d", cntr, rs2!DeliveryDt)
                    CurrentDb.Execute " Update Tbl_InvDetails set [" & colName1 & "] = [" & colName1 & "] + " & Q1 & " where Tbl_InvDetails.InvDate = #" & invDate & "#  ", dbFailOnError
            'Update flag after inventory updates
            ' The above if condition checks if an event is over.  Once the event is over, we need to give it green color.
            ' This also requires the flags to be udpated.  For this database, we use the below combination to indicate an event is over
            ' ProcessedInv = False and ProcessEventEndDt = False
            CurrentDb.Execute " Update Events set ProcessEventEndDt = False where Events.EventID = " & Id & "  ", dbFailOnError
            CurrentDb.Execute " Update Events set ProcessedInv = False where Events.EventID = " & Id & "  ", dbFailOnError
        End If
    DoCmd.SetWarnings True

    DoCmd.OpenForm "frmHiddenForm", , , , , acHidden
    End Function

    Monday, April 16, 2018 6:09 PM

All replies

  • Have you stepped through each line to determine which one is causing the error? It would be helpful to know.

    Monday, April 16, 2018 6:24 PM
  • Hi,

    What is the error message for 3420?

    Monday, April 16, 2018 6:44 PM
  • Hello Rhituraj,

    As Lawrence Ellefson said, I would suggest you debug the code line by line to check which line caused the error.

    Besides, For the convenience of reproducing your issue, I would also suggest you share a simply database file. Please remember to remove any sensitive information from the database.

    For sharing file, you could share the file via Cloud Storage, such as One Drive, and then put link address here. Thanks for understanding.

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, April 17, 2018 7:15 AM
  • Hi,

    What is the error message for 3420?

    Application-defined or object-defined error

    Paul ~~~~ Microsoft MVP (Visual Basic)

    Tuesday, April 17, 2018 12:00 PM
  • It's probably going to be:

    Set rs2 = Form_frmMainEvents.Recordset

    I don't know if a form can be defined as a recordset. I doubt it.

    Tuesday, April 17, 2018 1:20 PM
  • Hi,

    What is the error message for 3420?

    Application-defined or object-defined error

    Paul ~~~~ Microsoft MVP (Visual Basic)

    Hi Paul,

    Thanks. Which line gets highlighted when you go to Debug mode?

    Tuesday, April 17, 2018 2:48 PM