Results 1 to 11 of 11
  1. #1
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    479

    Can't resolve error


    The expression 0n Current you entered as the event property setting produced the following error: Object or class does not support the set of events.

    This is appearing as my db opens. I have put a Stop in the form load event and it happens before then.
    Debug-Compile doesn't complain. And it continues execution with everything working.
    How might I see what the problem as is I cannot step over any code to see it happening?

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,938
    What code do you have in the form current event? And does the form have subforms?

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    It happens when form opens. So close the form, set breakpoint(s), open form.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,879
    Debug-Compile doesn't complain.
    Do you have option explicit declared?
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  5. #5
    madpiet is offline Expert
    Windows 10 Office 365
    Join Date
    Feb 2023
    Posts
    566
    end the mystery. Post the code on the On Current event.

  6. #6
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,566
    Quote Originally Posted by madpiet View Post
    end the mystery. Post the code on the On Current event.
    Happens before the form load, according to the O/P, so I am with CJ_London on subform issue.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  7. #7
    madpiet is offline Expert
    Windows 10 Office 365
    Join Date
    Feb 2023
    Posts
    566
    <then post the code from that too?>
    Or just comment the code in the subform out temporarily. If that fixes it, that's the problem.

  8. #8
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Middlemarch,
    Responders have offered their best guesses-- time for you to show us some code or even better- a sample database that exhibits the issue.

  9. #9
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    479
    Thanks, replies appreciated. But have tried a breakpoint and there's no code to show/look at or comment out prior to the error happening.
    Yes there's a subform.
    So what the error is /means isn't known ? I'll move the Form to a new db and start removing controls, maybe that'll isolate it.
    Will advise.

  10. #10
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,938
    Subforms load before the main form so the issue is with the current event in your subform- perhaps it refers to the main form. But really not prepared to speculate if you can’t be bothered to post your code as requested

  11. #11
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    479
    It's not a case of can't be bothered. There's far too much to post without breaking to down to the relevant bits that show the error.
    However it's gone away and is working now. Here's what I did.
    Compact and Repair - it reopened with the error. So I created a new DB and imported the main Form, sub form, two queries that it wanted, and two linked tables.
    This opened and ran with no problem. I didn't expect that. Then went back to the original db and now the error no longer appears.
    To me that's not logical. The subform current event has no code. If it happens again I'll try a breakpoint there.

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

Similar Threads

  1. Replies: 15
    Last Post: 07-02-2024, 07:29 PM
  2. How to resolve #Name error?
    By alexsmith91 in forum Access
    Replies: 6
    Last Post: 10-24-2023, 08:53 AM
  3. var() does not resolve type mismatch error
    By deguza in forum Queries
    Replies: 5
    Last Post: 04-28-2023, 11:43 AM
  4. Resolve Error regarding missing object dependency
    By drunyan0824 in forum Access
    Replies: 18
    Last Post: 04-13-2023, 09:52 AM
  5. Replies: 2
    Last Post: 02-09-2017, 05:22 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