Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664

    This debug comple command jumps tp some outdated source code. What gives?

    I am having some program trouble with the file that I have attached to the post.



    When I open the frmEmail, it immediately points a out an error

    chk.TicketAssigned

    Okay, fair enough. When I try to debug by clicking compile from the menu it gives me a completely
    different source code set. It was something from a couple of days ago and it is no longer relevant.

    My executable lines a commented out. It is junk.

    What is going on? I want the source that I am working on now, not something a few days ago.

    I moved some subs programs around. Could that be it?

    Any help appreciated. Thanks in advance.

    Respectfully,

    Lou Reed
    Attached Files Attached Files

  2. #2
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    Please I really need an answer to this question. I am stuck here!

    Respectfully,

    Lou Reed

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I'm not clear on what you mean. When I compile, it takes me to lines of code that are not commented out, and are referring to controls that don't exist on the form the code is in.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    The lines of code that are commented out are from a previous db. I get the source code for frmEmail when I open it up and it gives an error. Fine. SO now I must debug.

    When I go to the Menu and click debug then compile it says compile database5. That is not my current database that I thought that I loaded!

    It is database5 and that is why I am getting all of this errors from a previous working version of the db which in my case is database5.

    So how do I change what compile debug-compile from database5 to me current db?

    That is the issue. I want do not care a whit about database5, I care about the current db.

    So how do I get it to change the debug-compile command and not compile database5, but instead compile the current db that I loaded, the current db?

    Any help appreciated. Thanks in advance.

    Respectfully,


    Lou Reed

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I think it's working on the current database, but I think I've seen that the original name never changes where you're seeing it. You probably also see it at the top of the Project Explorer window in the VB editor. Did you rename the db from Database5 to Division_Dashboard?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I'm talking about here by the way.
    Attached Thumbnails Attached Thumbnails Database5.jpg  
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    No I did not so I guess I will try it. Change the name in the way that you said.

    Thanks.

    Respectfully,


    Lou reed

  8. #8
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    What is the command to bring up the windows/screen in your last post? That is what I think that I need?

    Respectfully,

    Lou Reed

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    On mine it shows by default. If you're not seeing it:

    View/Project Explorer

    I don't think you can change the name, just be aware than when you change the name of a database, the original name is kept in that area. I've noticed it but never worried about it enough to look into changing it.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Actually you can change it. If you right-click on that top line and select Database5 Properties, you can change the name shown.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  11. #11
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    To change the name you see in "compile xxxxx", You need to open any code module. Then, from the menu, select Tools - xxxxx Properties. You can change the Project Name in the following screen. So, when you see Database5, it is in fact referring to the Current database, because that is the name in the Properties.

    When you do a compile, MS Access will attempt to compile ALL the code in the current database, not just the module you are in. This applies even to closed forms or reports. If you have disused or obsolete code with an error in it, you will continue to get compilation errors until you fix or delete the code.

  12. #12
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664

    It is still defaulting to the old code

    I did change the name of the database to debug. In the source code window click Tools then Project and change it there.

    It had no effect.

    As you can see in the database when you click debug-compile it stills goes back to the old useless
    db that I do not want to debug. I want the new one to debug. It does say debug Division-Dashboard however. But so what? It
    still acts the same way. There is just a new name.

    I know that you said you cannot change the name of the db and maybe this proves it. I just want to debug the current code
    not some outdated code.

    Any help appreciated. Thanks in advance.


    Respectfully,

    Lou Reed
    Attached Files Attached Files

  13. #13
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    The only thing that I cans see to do is to start over on this form and leave the source code behind. It may still be used to copy and pastes, but only if unavoidable.

    How can I copy a file without copying the source code?

    R, Lou Reed

  14. #14
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I'm not sure you can. The form is part of the file, and the code is part of the form. I think you'd have to delete the code after copying.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  15. #15
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    That is what I did and it worked. I cannot say if it has not any other effect, but it stays on the correct code when I click debug-compile.

    I removed the old outdated code just cut it out.

    Thanks for you help. This VBA stuff can really bog you down! I have proof.

    Respectfully,

    Lou Reed

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 03-29-2015, 07:42 PM
  2. Code runs in break/debug mode but not in normal mode
    By hansendl in forum Programming
    Replies: 2
    Last Post: 10-15-2014, 07:23 AM
  3. Autonumber field jumps on creating new record
    By Keith Maxwell in forum Programming
    Replies: 1
    Last Post: 08-05-2014, 07:42 AM
  4. Replies: 4
    Last Post: 11-26-2013, 10:47 AM
  5. Is There a Way to Debug or Step Through VB code?
    By jeffbase34 in forum Programming
    Replies: 1
    Last Post: 05-28-2009, 08:14 PM

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