none
Looking For Reference to Back End VBA Immediate Window Commands RRS feed

  • Question

  • Hello:

    I spend 90% of my time in the back end of Excel VBA.

    Now that I'm working on an Access project, I'm looking for a list and syntax of the "What Is" question in the immediate window of the VBA development.

    For example, in Excel I might ask this in the immediate window as I'm stepping through (F8) the statements:

    ? Cells(2,3).Value

    I'm looking for a comprehensive list of commands I can ask after the "?".  Does that exist for Access?

    It's so easy in Excel because you can generate code and get an idea.  But that capability doesn't exist in Access, so I need a good reference to those back-end questions I can ask in the immediate window.

    Thanks,


    Rich Locus, Logicwurks, LLC

    http://www.logicwurks.com

    Friday, October 4, 2019 2:27 AM

Answers

  • For example, in Excel I might ask this in the immediate window as I'm stepping through (F8) the statements:

    ? Cells(2,3).Value

    Hi RichLocus,

    I hardly use the immediate window. Instead I hoover over the variables with the mousepointer to see their momentary value.

    In case some properties of objects are not visible in this way, I have a global variable (Variant), say Rich, and add a line of code:

        Rich = cur_ctl.Tag

    Nice thing about adding it to the code, is that is always available on that place. If necessary you can comment it out.

    Sometime, e.g. in cases of RecordSources, I can add a line:    Show_value  Me.RecordSource, that opens a form with a large control to display the value.

    I also use a global Boolean to indicate whether I am in the Development mode or in the Production Mode. I can leave the code in place when the application is transferred to Production.

    Imb.

    • Marked as answer by RichLocus Saturday, October 5, 2019 4:32 AM
    Friday, October 4, 2019 8:15 AM
  • You can ask anything of the immediate window that you can put in your code, so it is pretty much limitless, just like in Excel.

    You can get general info (in the examples below Application. is not strictly necessary)

    ? Application.CurrentProject.Path
    ? Application.CurrentProject.FullName
    ? Application.CurrentProject.Name
    ? Application.CurrentDb.Name
    ? Application.CurrentDb.Version
    ? Application.CurrentDb.TableDefs("YourTableName").Fields.Count

    What type of information are you hoping to be able to access?  Perhaps understanding what it is you are hoping to gather would better helps us guide you.

    The issue is when working in the back-end, typically you are working with tables and queries, not VBA.  In the front-end, you can routinely check recordsource field values, control values, ... but in the back-end this is not very common.  This is why I'm asking what you are seeking as information.


    Daniel Pineault, 2010-2019 Microsoft MVP
    Professional Support: http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net


    Friday, October 4, 2019 6:58 AM
  • The ability of say word, or Excel to “generate” code is a great feature, and access is the only application from office that does not have this feature (macro recording).

    And interesting, access has both macros, and VBA.

    However, there are a few tricks/tips you can use.

    If you are debugging code in a form, then you can use:

    Me.”any control” goes here.|

    So, hitting me”dot” while debugging code in a form

    The above will fire inteli-sense, and give you a list of choices such as fieldnames/text boxes etc.

    You can pop up a list of VBA functions (to test + try expressions) with this:

    ? VBA.

    So “VBA.DOT” will fire up the functions you have in VBA.

    Eg:

    ? VBA.cint(15.5)

    And you can fire up functions specific to Access (not just VBA) with:

    ? Applicaton”dot”

    So, we don’t have a VBA macro recording, but the idea and concepts you use in Excel can quite much be used in the Access immediate window to pop up a list of choice.

    Thus:

    All the VBA functions as a choice (and this trick should work in Excel too) with  “? VBA.”

    All the special/special specific access centric functions/commands with “? Application.”

    And of course, if you break code in a form, then you can use:

    “me.”

    So, between the above 3 examples, then you do quite much have the same abilities as Excel when using the immediate window.

    A listing of all features in VBA, or access can be found in the help also. Just make sure you launch + use help from the VBA side, and not the access form/ide side.

    So you can type in any VBA command/function and while your cursor is still the command, then hit F1.

    So if in immediate you type  in

    Cint

    or as we now know, 

    VBA.Cint

    Then hit F1

    Regards,

    Albert D. Kallal (Access MVP 2003-2017)

    Edmonton, Alberta Canada

    • Marked as answer by RichLocus Saturday, October 5, 2019 4:31 AM
    Saturday, October 5, 2019 2:24 AM

All replies

  • You can ask anything of the immediate window that you can put in your code, so it is pretty much limitless, just like in Excel.

    You can get general info (in the examples below Application. is not strictly necessary)

    ? Application.CurrentProject.Path
    ? Application.CurrentProject.FullName
    ? Application.CurrentProject.Name
    ? Application.CurrentDb.Name
    ? Application.CurrentDb.Version
    ? Application.CurrentDb.TableDefs("YourTableName").Fields.Count

    What type of information are you hoping to be able to access?  Perhaps understanding what it is you are hoping to gather would better helps us guide you.

    The issue is when working in the back-end, typically you are working with tables and queries, not VBA.  In the front-end, you can routinely check recordsource field values, control values, ... but in the back-end this is not very common.  This is why I'm asking what you are seeking as information.


    Daniel Pineault, 2010-2019 Microsoft MVP
    Professional Support: http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net


    Friday, October 4, 2019 6:58 AM
  • For example, in Excel I might ask this in the immediate window as I'm stepping through (F8) the statements:

    ? Cells(2,3).Value

    Hi RichLocus,

    I hardly use the immediate window. Instead I hoover over the variables with the mousepointer to see their momentary value.

    In case some properties of objects are not visible in this way, I have a global variable (Variant), say Rich, and add a line of code:

        Rich = cur_ctl.Tag

    Nice thing about adding it to the code, is that is always available on that place. If necessary you can comment it out.

    Sometime, e.g. in cases of RecordSources, I can add a line:    Show_value  Me.RecordSource, that opens a form with a large control to display the value.

    I also use a global Boolean to indicate whether I am in the Development mode or in the Production Mode. I can leave the code in place when the application is transferred to Production.

    Imb.

    • Marked as answer by RichLocus Saturday, October 5, 2019 4:32 AM
    Friday, October 4, 2019 8:15 AM
  • After ? you can "ask" whatever meaningful expression you want/need ...from the value of a control to executing...to a function...
    Friday, October 4, 2019 8:41 AM
  • The ability of say word, or Excel to “generate” code is a great feature, and access is the only application from office that does not have this feature (macro recording).

    And interesting, access has both macros, and VBA.

    However, there are a few tricks/tips you can use.

    If you are debugging code in a form, then you can use:

    Me.”any control” goes here.|

    So, hitting me”dot” while debugging code in a form

    The above will fire inteli-sense, and give you a list of choices such as fieldnames/text boxes etc.

    You can pop up a list of VBA functions (to test + try expressions) with this:

    ? VBA.

    So “VBA.DOT” will fire up the functions you have in VBA.

    Eg:

    ? VBA.cint(15.5)

    And you can fire up functions specific to Access (not just VBA) with:

    ? Applicaton”dot”

    So, we don’t have a VBA macro recording, but the idea and concepts you use in Excel can quite much be used in the Access immediate window to pop up a list of choice.

    Thus:

    All the VBA functions as a choice (and this trick should work in Excel too) with  “? VBA.”

    All the special/special specific access centric functions/commands with “? Application.”

    And of course, if you break code in a form, then you can use:

    “me.”

    So, between the above 3 examples, then you do quite much have the same abilities as Excel when using the immediate window.

    A listing of all features in VBA, or access can be found in the help also. Just make sure you launch + use help from the VBA side, and not the access form/ide side.

    So you can type in any VBA command/function and while your cursor is still the command, then hit F1.

    So if in immediate you type  in

    Cint

    or as we now know, 

    VBA.Cint

    Then hit F1

    Regards,

    Albert D. Kallal (Access MVP 2003-2017)

    Edmonton, Alberta Canada

    • Marked as answer by RichLocus Saturday, October 5, 2019 4:31 AM
    Saturday, October 5, 2019 2:24 AM