Results 1 to 3 of 3
  1. #1
    MarkA70 is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Jan 2016
    Posts
    6

    Question What is wrong with this code

    This Code:




    Dim db As DAO.Database
    Dim rstAttendance As Recordset
    Set rstAttendance = CurrentDb.OpenRecordset(Name:="Attendance", Type:=RecordsetTypeEnum.dbOpenDynaset)

    With rstAttendance
    .FindFirst [Member_ID] = Me.Member_ID
    .Edit
    ![Dues_Paid_Family] = Me.Dues_Family_Years_Paid * Forms!frm_hidden.txt4_Hidden
    ![Dues_Paid_Single] = Me.Dues_Single_Years_Paid * Forms!frm_hidden.txt5_Hidden
    .Update
    End With

    rstAttendance.Close
    Set rstAttendance = Nothing
    db.Close
    Set db = Nothing



    Generates the Error
    Run-Time Error 91
    Object variable or With Block Variable not set, pointer set on the db.Close statement.


    What is up with that????

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    You never set the db variable.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716

Please reply to this thread with any new information or opinions.

Similar Threads

  1. vba code running in wrong order??
    By Paintballlovr in forum Programming
    Replies: 3
    Last Post: 08-30-2013, 03:53 PM
  2. Whats wrong with this code?
    By shabbaranks in forum Programming
    Replies: 2
    Last Post: 03-20-2012, 08:01 AM
  3. What's wrong with my code?
    By Dalagrath in forum Forms
    Replies: 11
    Last Post: 05-18-2011, 04:34 PM
  4. What is wrong with this code?
    By nkenney in forum Forms
    Replies: 2
    Last Post: 11-16-2009, 03:04 PM
  5. Anything wrong with this one line of code?
    By alsoto in forum Reports
    Replies: 3
    Last Post: 07-01-2009, 09:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums