Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Rico is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    Perth Australia
    Posts
    29

    View code button top right corner of form does not display code on first try, stays on the form.

    Comes up quickly on the second click.
    Is it because my program has got to big.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    What "view code" button are you talking about - a custom button?
    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.

  3. #3
    Rico is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    Perth Australia
    Posts
    29
    Thanks June7, I am in forms design, the 'view code' button is in the Tools area in the top right of screen.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Do you have database set for Tabbed Documents? I always use Overlapping Windows.

    That button is not actually on the form. It is on the ribbon.

    When clicked first time do you immediately get the circular "working" cursor?
    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.

  5. #5
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,861
    Wow all these years and I've never used that button.
    What happens if you go to the Database tools tab and click on Visual Basic?
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  6. #6
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,128
    You can also view the code using a button on your form. Use the following code on the button click event:

    Code:
     DoCmd.OpenModule "Form_" & Me.Name
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  7. #7
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,283
    Quote Originally Posted by moke123 View Post
    Wow all these years and I've never used that button.
    What happens if you go to the Database tools tab and click on Visual Basic?
    Me too though for less years no doubt.
    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

  8. #8
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,861
    Regardless of which button I use to open the VBE, the first time I open it there is a very slight delay as opposed to subsequent openings. I would venture a guess that's due to loading add ins like M-z tools and smart indenter.
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  9. #9
    Rico is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    Perth Australia
    Posts
    29
    With the form open on my screen, if I click the - View Code - button, the circular "working" cursor comes on for 7 to 10 seconds, then stays on the form screen.
    If I click it a second time the code screen comes up straight away.
    Going thru the Property Sheet is no better.
    Going thru the
    Database tools tab and click on Visual Basic is no better.
    This does NOT happen to my smaller programs.

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Sorry, cannot replicate issue. Even with my largest db the VBE opens after several seconds without having to do a second click.
    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.

  11. #11
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,372
    Time to ask how big the file is, especially since you raised the prospect in the first post?
    Maybe it's the size, or it needs a compact/repair. Or it needs a decompile and recompile as well as c/r.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  12. #12
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,128
    It may be that you already have a lot of code windows open.
    Close all code windows in the VBE then try opening the VBE again. This time it should open much faster.
    If you have MZ Tools or similar, you may be able to click a menu command to close all open windows.
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  13. #13
    Rico is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    Perth Australia
    Posts
    29
    The size of the file is 32,432 KB .accdb
    This size is AFTER I have compact/repair.
    I only have one form open with no code windows open.
    This file does not have TABLES, they are linked in from another file.
    I do not have the same problems with my smaller size programs.

  14. #14
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    My db is 28,504 KB accdb.
    Takes about 10 seconds for VBE to open. Then every single code module is open. I don't know any way to prevent that.
    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.

  15. #15
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,128
    Just tested n a Access FE of 34428 KB and another of 144940 KB.
    In each case, the VBE opens instantly if no other code windows are open.
    There is a delay of 1-2 seconds if other code windows are open depending on the number of windows

    For info, I'm using a very slow 11 year old workstation which runs Win10 & Office 365
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

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

Similar Threads

  1. Replies: 2
    Last Post: 03-11-2015, 07:13 AM
  2. Replies: 3
    Last Post: 10-20-2014, 03:25 PM
  3. Display lookup value in form, not code.
    By lggerhard in forum Forms
    Replies: 2
    Last Post: 09-10-2014, 06:57 PM
  4. Replies: 3
    Last Post: 07-20-2012, 11:41 AM
  5. Code to call Split Form View Datasheet
    By ahightower in forum Programming
    Replies: 1
    Last Post: 07-28-2011, 04:57 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