Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Run-time error '2475' when stepping into code

  1. #1
    Board Regular
    Join Date
    Jan 2003
    Location
    Huntsville, AL
    Posts
    143
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Run-time error '2475' when stepping into code

    I've set a variable to the active form name and it works fine when the form is active, however, I'm trying to debug part of the code that doesn't work right and when it gets to where it sets the variable to the active form, it gives a Run-time error '2475' message: You entered an expression that requires a form to be the active window.

    This only happens when running the code in the editor (I'm stepping into each line) so the form isn't active, the editor is. How do I get around this so I can debug the rest of the code?

    Dim frm as Form

    Set frm = Screen.ActiveForm
    -dar

  2. #2
    Board Regular ranman256's Avatar
    Join Date
    Jun 2014
    Location
    Kentucky
    Posts
    1,685
    Post Thanks / Like
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Run-time error '2475' when stepping into code

    you dont call forms that way. Thats a VB6 method.
    in Access, use: docmd.openform "frmMyform"

    (even if its already open, it will summon it to the front)

  3. #3
    Board Regular
    Join Date
    Jan 2003
    Location
    Huntsville, AL
    Posts
    143
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Run-time error '2475' when stepping into code

    Thanks. That worked.
    -dar

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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