Results 1 to 11 of 11
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Run-time error 2467? (A97 SR-2)

    Run-time error 2467?

    A97 SR-2

    A picture is worth a 1000 words.

    Find attached an a97 db that works OK in a2k but gets following error in a97:

    Run-time error 2467- The expression you entered refers to an object that is closed or dosen
    Attached Files Attached Files

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Run-time error 2467? (A97 SR-2)

    John,

    The reason of the error is that the function is running twice in Access 97.
    When the function runs the second time, the form is closed and could not find the Me![autVendorKey] as the form was closed when in the first run.
    Why it run twice ? I could not find it.
    I have modify the database in a manner how I would solution the problem, with only one form.
    If you want you could add a me.maximize to switch to full screen in datasheet view to the sub under the view button.
    You should then add me.restore to the function SwitchView
    If you like it let me know, otherwise I'll try to find why the function is running twice tomorrow.
    Attached Files Attached Files
    Francois

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Run-time error 2467? (A97 SR-2)

    Hi Francois

    I like your solution, I can see use for it in some other applications, however what I was trying to accomplish gives me more control over what I give the user.

    What's puzzeling, this same code works OK with a2k. Its something ethier you or Hans helped me with months ago and I use the concept in most a2k major screens, users really love it.

    Trying to move the same look and feel to several a97 users and I'm stumbling on this error message, would like to know why function is running twice.

    Thanks for your help.

    John

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Run-time error 2467? (A97 SR-2)

    John,

    In the DblClick event of the text boxes in frm_Vendors_View, you have

    =<!t>[autVendorKeyJump]<!/t>

    At least, it is displayed that way in my Access 97.

    If I replace this by

    =autVendorKeyJump()

    the code runs only once, so the problem doesn't occur. No idea why, but the =Function() format is the one used by Microsoft in the help files.

    Regards,
    Hans

  5. #5
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Run-time error 2467? (A97 SR-2)

    Just found it, but Hans beat me. <img src=/S/weep.gif border=0 alt=weep width=21 height=16>
    Francois

  6. #6
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Run-time error 2467? (A97 SR-2)

    To contribute a little more, I have moved your code directly in the autVendorKeyjump function and delete the function on click.
    Attached Files Attached Files
    Francois

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Run-time error 2467? (A97 SR-2)

    Don't worry, Francois. Most of the time your replies are much faster than mine, and better too! <img src=/S/wink.gif border=0 alt=wink width=15 height=15>

    Hans

  8. #8
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Run-time error 2467? (A97 SR-2)

    Faster, sometimes,
    Better ? Many times there are different ways to solve a problem in Access and it not evident to say witch the best is.
    The strange thing in this case is that i have to look 1 hour yesterday and 1 hour today to see that you don't call a function with =[function] but with =Function().
    I think I'm getting old <img src=/S/gramps.gif border=0 alt=gramps width=20 height=20>
    Francois

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Run-time error 2467? (A97 SR-2)

    As Charlotte once told me, you are only as old as you feel <img src=/S/grin.gif border=0 alt=grin width=15 height=15>.

    I'm certain that many Loungers consider you to be one of the best! <img src=/S/clapping.gif border=0 alt=clapping width=19 height=23>

  10. #10
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Run-time error 2467? (A97 SR-2)

    Hi Francois & Hans

    Works fine now.

    Recap for others.

    Chalk it up to one of those slight differencec between a97 ans a2k

    Duble Click Event =[autVendorKeyJump] (works on a2k, errors on a97)

    I changed all my working apps as follows:

    Duble Click Event =autVendorKeyJump() (works on a2k and a97)

    The reason for the Sub was so I can put =autVendorKeyJump() in every fields double click event

    Function autVendorKeyJump() ' this is fired when user double clicks in any field
    Call autVendorkey_DblClick(False)
    End Function

    Private Sub autVendorkey_DblClick(Cancel As Integer)
    Dim strSQL As String
    strSQL = "SELECT * FROM tblVendors WHERE autVendorKey = " & Me![autVendorKey]
    Forms(mstrParentFormName).RecordSource = strSQL
    DoCmd.Close acForm, Me.Name
    End Sub

    Thanks, for your help

  11. #11
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Run-time error 2467? (A97 SR-2)

    I'll second that sentiment! <img src=/S/fanfare.gif border=0 alt=fanfare width=31 height=23>
    Charlotte

Posting Permissions

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