• Object Variable Not Set (2000)

    Author
    Topic
    #391810

    Hi,

    I’m in the process of updating/revising a database I did about a year ago with some of the new code I’ve learned from the forum over the past weeks. I’m begining to think I’m nuts to even try!

    Anyway, I’m trying to open frmTimesheet to the name that is doubleclicked on frmEmployeeName. The form needs to open to a new record. I’ve used the follow code over and over in other instances with no problem. In this instance I’m getting an error message that states “Object variable or With Block Variable not set”. I’m not sure what is missing.

    ‘ Find the record that matches the control.
    Dim rs As Object

    Set rs = Me.Recordset.Clone
    rs.FindFirst “[Auto Number] = ” & Str(Me![lstEmployeeName])
    Me.Bookmark = rs.Bookmark

    “Set rs = Me.Recordset.Clone” is the section highlighted when debugged.

    I’ve enclosed a stripped down copy.

    Thanks,
    Leesha

    Viewing 1 reply thread
    Author
    Replies
    • #701254

      Access crashes the moment I try to convert this Access 97 database to Access 2000. I could, however open it without converting.

      frmEmployeeName is an unbound form, i.e. its Record Source property is empty. So Recordset.Clone is not valid – there is no recordset.

    • #701482

      I opened this in ACCESS 97, and I’m not sure what it is you are attempting to accomplish. You are trying to send an Auto Number as the opening argument to another form with its own Auto Number field, which you can’t do. You have dropdown boxes for most fields, including the Employees Name (with the Auto Number bound to the textbox already and is the same as the one you were attempting to pass). Seem like you already have the info available to you and the extra form isn’t required.

      PaulF

      • #701521

        Hi Paul,

        This database is about a year old and I’ve come a long way since I first built it due to the help of the lounge. The DB itself works fine and the user is satisfied, however one of the data entry person’s requests has always been to “NOT” have to enter in the employee name a gazillion times, as in with each entry on the the time sheet. It’s not a biggie to them as once they type a few letters the employee name comes up, it was just a request. I do not want to make a major overhaul to the database tables as they already a year’s worth of data in them etc. However, my hope was to be able to open frmTimesheet from frmEmployeeName so that frmTimeSheet opened to a new record with the employeeID already chosen. This would at least alleviate a few key strokes. Even after assigning frmEmployeeName to a control (I’ve tried tblTimesheet and tblEmploee) I’m not having any luck.

        Leesha

        • #701538

          Post your latest DB Leesha.

          • #701539

            Hey Bud!

            Just came in from mowing the lawn. Will be a bit before I can post it. I’m not sure its worth the work.

            Good to hear from ya,
            Leesha

          • #701567

            Hi Pat,

            Here ya go. As per my normal format, I’d like frmTimesheet to open to the name doubleclicked on frmEmployeeName. I’m not even sure its possible without major table changes which I’m not really into doing. Let me know if you think it’s a no go. I’ll actually conceed defeat if you so.

            Leesha

            • #701571

              I just tried to convert the A97 DB and I got an error message saying this database was created in an earlier version of Therapyworks? What on earth is Therapyworks?
              If your database is A2000 then email that to my profile email as a zipped file of course.

    Viewing 1 reply thread
    Reply To: Object Variable Not Set (2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: