Results 1 to 6 of 6
  1. #1
    mdavid is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Oct 2017
    Posts
    160

    Do I need such detailed references

    Hi, I have a listbox on a subform and I want to display the .ListCount property underneath it, the following displays this



    Code:
    Forms![MempBercMainFrm2].[Form]![MempBercListBox].[Form]![txtTotMemp] = Forms![MempBercMainFrm2].[Form]![MempBercListBox].[Form]![lstbMempComplaints].
    [ListCount]
    What I was wondering is if there is a way to shorten this expression? Gets really tiring writing out these long qualifiers every time

    Thanks for any help
    David

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Where is the code? You can use "Me." as a shortcut to refer to the object containing the code. If the code is in the subform, it could simply be:

    Me.[txtTotMemp] = Me.[lstbMempComplaints].
    [ListCount]
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    mdavid is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Oct 2017
    Posts
    160
    Sorry to waste your time - but if I hadn't asked I wouldn't have thought of writing =[lstbMempComplaints].
    [ListCount] in the Control Source.
    Just needed someone to talk to.

    Thanks
    David

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Always glad to lend an ear.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    mdavid is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Oct 2017
    Posts
    160
    Hi Paul, I tried to do this, but when I typed "Me." into expression builder I didn't receive any options so I thought it wasn't right

  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
    Me is only valid in VBA code. It wouldn't work in a control source, query, etc.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 4
    Last Post: 01-25-2017, 06:12 AM
  2. Replies: 2
    Last Post: 04-03-2016, 02:00 PM
  3. Replies: 2
    Last Post: 05-06-2014, 12:33 PM
  4. Detailed Inventory / Supplier DB
    By gwallace1 in forum Database Design
    Replies: 1
    Last Post: 06-27-2012, 05:31 PM
  5. More detailed subtotals
    By kcmiuser in forum Queries
    Replies: 0
    Last Post: 06-27-2011, 06:10 AM

Tags for this Thread

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