Results 1 to 3 of 3
  1. #1
    davideps is offline Novice
    Windows Vista Access 2007
    Join Date
    Apr 2012
    Posts
    2

    Selected row of subform triggers query with results displayed on master form?


    Hi everyone,

    I would like to use a subform to trigger a query and display the results as text on the master form (or as a tooltip, if the option is available). I will use as an example the familiar setup of an author table, book table, and association table called author-books

    AUTHOR TABLE
    --------------
    id first last firstlast biomemo


    BOOK TABLE
    ------------
    id title year


    AUTHOR-BOOK TABLE
    ---------------------
    id authorid bookid


    The "firstlast" column of the AUTHOR table is already generated programatically in the AUTHOR form when the user edits the "first" or "last" fields. I have a BOOK form with an AUTHOR-BOOK subform that displays the "firstlast" column of the AUTHOR table. When someone clicks on a row in this subform, I want the biographical notes about the author (biomemo) to display somewhere on the form or to hover over the row like a tool tip. I believe I need to add code to the "current" event of the subform. I am unsure how to query the author table using the "authorid" from the selected subform row and unsure how to assign the "biomemo" result to the text of a form label or other visual element. I welcome any advice.

    Thank you,
    -david

  2. #2
    alcapps is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jan 2012
    Posts
    292
    I am not sure I got your setup in my mind. But if you main form is using the Author Table as the base are you hiding the biomemo feild?
    anyway you can call the field by putting the biomemo field on the main form and making it's visible property to false
    in the on current of the sub form make a text box = me.parent.biomemo.

    you can also..
    textbox = dlookup("Author","biomemo","[ID] =" & me.parent.ID)

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Can 'zoom' the memo field contents. Review http://www.utteraccess.com/forum/Zoo...-t1539451.html

    Why programmatically save firstlast data to table? This could just be calculated in query or textbox when needed.

    One way to show the associated AUTHOR TABLE info is to include that table in the RecordSource of the subform. Join type 'Include all records from AUTHOR-BOOK TABLE'. Set the controls bound to AUTHOR TABLE fields as Locked Yes and TabStop No so they can't be edited.
    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.

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

Similar Threads

  1. Issues with subform and master form
    By asmith533 in forum Forms
    Replies: 14
    Last Post: 09-24-2012, 09:13 AM
  2. Replies: 1
    Last Post: 07-20-2012, 09:48 AM
  3. Replies: 1
    Last Post: 10-13-2010, 12:40 PM
  4. Limiting the results displayed in a report
    By musicalogist in forum Reports
    Replies: 1
    Last Post: 06-10-2010, 04:44 PM
  5. Search Form Results Displayed In Report
    By warrenjburns in forum Forms
    Replies: 1
    Last Post: 03-18-2009, 02:08 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