Results 1 to 5 of 5
  1. #1
    MatthewGrace is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2013
    Posts
    159

    Does Intellisense not work in collections?

    When I type "TextboxName.xxxxxx"

    As soon as I type the "." a list of options appears. I've always like this feature.

    However, when I type "Forms!" a list does not appear. At this point, I'll manually enter the Form Name>>Control>>Property I wish to reference - in all lowercase - and press the Enter key. Next, Access is supposed to automatically update everything to camel case, which serves as feedback for me that I entered everything correctly. But it only does that for things with a "." and not a Collections "!"

    Is this normal? Is there an option somewhere in the menu I have turned off?



    Thank you,
    Matt

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Yes, that is true in VBA. Try this:

    Form_yourFormName.

    You should see in the VBE Project pane that form and report names have prefix. This is how VBA "knows" these objects for intellisense.
    Last edited by June7; 05-21-2020 at 11:03 PM.
    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
    MatthewGrace is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2013
    Posts
    159
    If I type:
    Forms_frmCreateBatch.
    nothing special happens.


    But what I think I'm hearing from you is that the Intellisense works for the "." but will never work for Collections which use a bang "!". Is that right? For example:

    Form1. 'Produces intellisense dropdown.
    Forms! 'Does NOT produce intellisense dropdown. There is no way to fix this.

    Do I have that right?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Remove the s from Forms_frmCreateBatch
    Form_frmCreateBatch.

    Sorry, that was my typo in previous post, corrected.

    ! will trigger tips in queries and expression builder and in some properties in Property Sheet, such as ControlSource.

    Correct, this is not changeable.
    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
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    the reason is that when you use a . the property is early bound so intellisense works - and typo's will be picked up when the code is compiled. When you use a ! the property is late bound so intellisense cannot work because the property is not assigned until the code is run.

    It is generally recommended you use . rather than ! where possible, but collections are always late bound. The forms collection is a collection of open forms, and that could be anything at the time the code is run


    within a form module try

    me.fieldname - and you get intellisense
    me!fieldname - no intellisense

    me.typoname - compile fails
    me!typoname - compile succeeds, but you will get an error when the code is executed.


    recordsets are also collections which is why when you reference a field you (can) use ! since this cannot be defined until the recordset is open. But recordsets also have properties which are known at compile time so you you would use a . for those.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Types, classes and collections
    By martingaleh in forum Programming
    Replies: 4
    Last Post: 12-02-2015, 05:12 PM
  2. Add more Intellisense to UDF in access
    By Perceptus in forum Programming
    Replies: 6
    Last Post: 09-17-2015, 03:12 PM
  3. Budget and Collections(Actuals)
    By dref in forum Queries
    Replies: 20
    Last Post: 08-23-2012, 06:12 AM
  4. Budget and Collections(Actuals)
    By dref in forum Forms
    Replies: 0
    Last Post: 08-19-2010, 03:39 AM
  5. intellisense not behaving
    By avianrand in forum Programming
    Replies: 3
    Last Post: 06-18-2010, 04:59 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