none
is there a setting for that? RRS feed

  • Question

  • One of the most irritating things about Access is where it doesn't allow you to make contact with the form that the debugging alert is for.  I make changes to the form's code. Close VBA, test and VBA opens and says there's a compile error.  My form now hides behind the form that launched it.  I can't click on my form to bring it to the front.  I have to minimize all the forms in front of it.  Then I can't set it to design mode to find out what the proper spelling is for a control or anything.  Besides closing VBA, is there a setting that overrides this retarded behavior?  If I get a Compile error for FormA, I should be able to look at FormA to try to fix it.
    Wednesday, March 9, 2016 6:38 PM

Answers

  • As a general principal, I am against most encodings, but it helps sometimes to encode your control objects. For example txtSearchCriteria or btnSearch.

    Then you can just quickly use the a line of code to see the correct spellings. As you begin to type you will see the InteleSense pick up your control names. For example: Me.btn will drop down a window with all that window's controls that begin with the letters btn.

    You can't interact with the GUI of a form window while the code file for that code is executing, so if it is just to get values of particular fields, you can use Watches and debug.print statements in the code or in the immediate window.

    Also, I would suggest you create some personal development tools that help your style of development. For example, create a module that has a procedure you can pass a reference to a form that prints all it's control names to the immediate window.
    Wednesday, March 9, 2016 8:49 PM

All replies

  • In the code window there is a "form" icon right below the project object window. If you click on that it will bring you to the Access window. That form should be on top.


    Bill Mosca
    www.thatlldoit.com
    http://tech.groups.yahoo.com/group/MS_Access_Professionals

    Wednesday, March 9, 2016 8:20 PM
  • As a general principal, I am against most encodings, but it helps sometimes to encode your control objects. For example txtSearchCriteria or btnSearch.

    Then you can just quickly use the a line of code to see the correct spellings. As you begin to type you will see the InteleSense pick up your control names. For example: Me.btn will drop down a window with all that window's controls that begin with the letters btn.

    You can't interact with the GUI of a form window while the code file for that code is executing, so if it is just to get values of particular fields, you can use Watches and debug.print statements in the code or in the immediate window.

    Also, I would suggest you create some personal development tools that help your style of development. For example, create a module that has a procedure you can pass a reference to a form that prints all it's control names to the immediate window.
    Wednesday, March 9, 2016 8:49 PM
  • During debug, clicking this icon only makes the code window blink.
    Friday, March 11, 2016 3:35 PM
  • My Access project has lots of VBA code in it.  I prefer VBA code over the built in macros, as it provides more flexibility.  The InteleSense is good for some things but not everything, like calling a query name or a web address.  I hope that some MS developer reads this and sees that it's a need to be able to look at your form window while you're debugging it.  Thanks.
    Friday, March 11, 2016 3:40 PM
  • Looks like you need a second monitor so you can open the code window on one and the Access shell on the other. 

    Bill Mosca
    www.thatlldoit.com
    http://tech.groups.yahoo.com/group/MS_Access_Professionals

    Friday, March 11, 2016 7:24 PM
  • No, InteleSense can not provide everything. That is why I suggested creating some modules that can give you all property values of every object on any form. There is almost no limit to the information you can iterate through in the VBA. Unless you need to see some kind of graphical glitch or something, I can't even think of any reason a developer can't access the data on a Form via code. I could be overly optimistic on that though.

    I'm not sure what you mean by calling a query name, but you can see the name of all queries in the AllQueries collection. If your form is bound to a query you can look at the RecordSet property.

    Perhaps if you show a screen shot of your Form and your code, someone can explain to you how to get the information you need via VBA.

    And like Mosca said, if you have 2 monitors or when you replicate the bug if you make sure the only form open is the form with the bug, it will stay visible but you can't scroll up/down left/right.
    Friday, March 11, 2016 10:28 PM
  • Hi Carl,

    In the above picture (thanks Bill) you can switch to the form screen using the Access icon on the left side of the picture.

    Next you can use the Window button (behind Add-ins) to bring a background form to the foreground. However, this does not go further back than a dialog form.

    Is this what you want?

    Imb.

    Friday, March 11, 2016 10:51 PM
  • In my project, for this example, I have 2 forms that I go thru to bring up the form I want to work on, so Form A opens, I click Button 1, which opens Form B.  On Form B, I click button 3, which should bring up Form C, however, there's an error and I need to debug.  So instead of intelligently showing me Form C and the code (dual monitors), Form C hides behind Form A and won't allow you to click on it.  Clicking the button in the pic above only makes the VBA window blink.  In order to see Form C, I must minimize Form B and then Form A.  But I can never set Form C to design mode unless I end debugging.  If I'm debugging Form C, Form C should come to the front and at very least allow me to manually enter design mode.  Unfortunately I don't have any of these issues right now but it it is a recurring theme.  This is more of a gripe (that I hope MS sees and thinks about) than something I actually think is resolvable. 
    Tuesday, March 15, 2016 2:22 PM