Results 1 to 4 of 4
  1. #1
    Puebles is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2013
    Location
    Lansing, MI
    Posts
    14

    Run time erro 91


    Hello.

    I am getting the run time error 91 indicating that the variable is not set. I do not understand why I am having this error at this particular time.

    The puropse of this procedure is to check on update where we are in the procedure (Function FindOutWhereWeAre) to toggle the enabled property on various controls. When rs3!WhereAreWe = 1 this indicates that the Download FromDate or ToDate has been changed and the download must be re-ran prior to processing or reporting.

    Code:
    Private Sub fldFromDate_AfterUpdate()
    
    Dim rs3 As DAO.Recordset
    Set rs3 = db.OpenRecordset("tblControl", dbOpenTable) ' This is where I am getting the error.
    rs3!WhereAreWe = 1
    FindOutWhereWeAre (rs3!WhereAreWe)
    
    End Sub
    This line that errors out is used in several procedures without an issue.

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    You need to assign your recordset to a database. Maybe CurrentDB. DB or db has not been declared. That is the error

    Dim db as DAO.Database
    set db = CurrentDB

  3. #3
    Puebles is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2013
    Location
    Lansing, MI
    Posts
    14
    Yikes...I feel stupid....db was noit declared in that procedure.

    Sorry.

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Not a problem. I try to close my db declarations and set to = Nothing at the end of the routine. This way an error does not sneak up if a routine may be depending on a previous declaration

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

Similar Threads

  1. Replies: 42
    Last Post: 03-01-2013, 06:58 AM
  2. Erro #Name?
    By Ray67 in forum Reports
    Replies: 17
    Last Post: 07-03-2012, 01:49 PM
  3. Replies: 1
    Last Post: 02-28-2012, 09:16 PM
  4. Dim DAO as DB Erro
    By jo15765 in forum Programming
    Replies: 7
    Last Post: 06-23-2011, 11:52 AM
  5. Runtime Erro will not install
    By drunkinmunki in forum Access
    Replies: 4
    Last Post: 12-16-2010, 06:56 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