Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2012
    Posts
    4

    Unanswered: Event Procedure won't run on another machine

    I created a combo box to help users navigate between records in form view. They can type in or select from a list.

    Several of us access a database that lives on a central server. The form works on everyone's computer except for my boss's! For some reason she gets error messages. I can't figure this out. I've tried re-building the form, tweaking security levels, I even made her the "owner" of the form. Once I got it to work, but when I tried again, the error messages reappeared.

    We are all using Access 2003. NOTE: My boss is running two versions of MS Access on her computer: 2010 and 2003. Our IT support set it up for 2003 to load when she opens the shared database. I suspect this might be the problem.

    Any ideas?

    Here's the code:

    Private Sub Combo53_AfterUpdate()
    ' Find the record that matches the control.
    Dim rs As Object

    Set rs = Me.Recordset.Clone
    rs.FindFirst "[SF #] = '" & Me![Combo53] & "'"
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark
    End Sub

    Private Sub Form_Current()
    Me.Combo53 = Me.[SF #]
    End Sub
    Last edited by Cynthiac; 05-12-12 at 00:15.

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Quote Originally Posted by Cynthiac View Post
    ... For some reason she gets error messages. I can't figure this out.
    Nor can we if you dont post any pieces of information about these errors: Error number and Message.
    Quote Originally Posted by Cynthiac View Post
    We are all using Access 2003. NOTE: My boss is running two versions of MS Access on her computer: 2010 and 2003. Our IT support set it up for 2003 to load when she opens the shared database. I suspect this might be the problem.
    Using 2 different versions of Office programs on the same machine is known for causing numerous problems and Microsoft does not recommend this practice.

    From the code you posted I can only state that:

    1. You should not use the Recordset of a form directly and this:
    Code:
    Set rs = Me.Recordset.Clone
    Should be replaced with:
    Code:
    Set rs = Me.RecordsetClone
    2. You should properly declare the variable you use to avoid late binding (this is VBA, not VBScript). This:
    Code:
        Dim rs As Object
    Should be replaced with:
    Code:
        Dim rs As DAO.Recordset
    3. You should not use spaces nor any non-alphanumeric characters in the names of the objects. This:
    Code:
    Me.[SF #]
    Should be (for instance) replaced with:
    Code:
    Me.SFNumber]
    4. You should use meaningful names for these objects and properly reference them. This:
    Code:
    Me![Combo53]
    Should be (for instance) replaced with:
    Code:
    Me.ComboSFNumber.Value
    5. You should clean up after yourself and close any object you open in a procedure:
    Code:
        If Not rs.EOF Then Me.Bookmark = rs.Bookmark
        rs.Close
    End Sub
    Have a nice day!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •