Results 1 to 7 of 7
  1. #1
    russdwright is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Posts
    30

    Question Open Report when clicking label for Text Box

    I've done a little searching online but have not had much luck, so I'm hoping someone on the forum knows what to do ...



    I have a form with multiple Text boxes. The Text Boxes are showing summary results, but I want to be able to load more detailed reports I have developed when I click on the label for each Text Box.

    Is this possible, or do I need to use a different object to achieve this result?

  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,518
    In the click event of the label:

    DoCmd.OpenReport "ReportName, acViewPreview
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    text boxes are bound to the form ,which is bound to the query.
    you want to load a report when you click a label?

    make a table of reports.
    in the form , show them in a listbox.
    dbl-click the item in list to have it open the report.

  4. #4
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,389
    Click image for larger version. 

Name:	label.JPG 
Views:	14 
Size:	20.6 KB 
ID:	35457

    If a label is attached to a textbox, it has no events exposed.
    So, delete the entry in yellow and the label becomes clickable.

  5. #5
    russdwright is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Posts
    30
    Figured it out!

  6. #6
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    Quote Originally Posted by pbaldy View Post
    In the click event of the label:

    DoCmd.OpenReport "ReportName, acViewPreview
    As ranman256 said, there are no events for attached Labels.

    If it were me, I'd simply use the DoubleClick event for the Textbox itself to run the code.

    @russdwright: Forum etiquette requires that when the original poster independently finds a solution to the posted problem, that solution be posted. This helps others who may find their way to the thread solve similar problems.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  7. #7
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    sorry guys, you've been wasting your time - cross posted here

    https://www.access-programmers.co.uk...84#post1591184

    OP advised of the etiquette but has not had the courtesy to advise you of that fact.

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

Similar Threads

  1. Sort Data by Clicking Label
    By LonghronJ in forum Modules
    Replies: 18
    Last Post: 08-03-2017, 05:16 AM
  2. Report Question on Calculated Label or Text Box
    By mrmmickle1 in forum Access
    Replies: 4
    Last Post: 07-26-2015, 11:09 AM
  3. Replies: 3
    Last Post: 07-11-2013, 11:52 AM
  4. Clicking on label adds new record?
    By swimmermx in forum Forms
    Replies: 1
    Last Post: 07-25-2010, 07:03 AM
  5. Clicking on label opens up new record
    By swimmermx in forum Forms
    Replies: 2
    Last Post: 07-20-2010, 03:58 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