Results 1 to 7 of 7
  1. #1
    noretoc is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2012
    Posts
    18

    text box that shows data form selected subform record

    I personally have not see any examples of this, but I have a feeling It can be done, I just don't know how. I am a access amateur. I built this DB and have a subform with info from another table. It filters on CityName, and displays all records in a table format like shown in the pic attached. I would like to add a text box that will show a specific field in the record based on the record that is currently selected.


    So in the example, I need to know how to set the properties of the text box, so when I select the record Timmet Steele, in the subform, the text box to the right displays the text in the Notes field from that table for the record Timmet Steele.
    Any help would be greatly appreciated.
    Attached Thumbnails Attached Thumbnails dbpic.jpg  

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    20,827
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    noretoc is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2012
    Posts
    18
    Quote Originally Posted by pbaldy View Post
    Afraid not, that is looking at it as two levels. IT works fine to display the info from the main form, btu not the sub form.
    So the Main form is pulling in a record from table a (City). The sub form is pulling in info from table b (people). It is filtering table b to show only records which match the record in table A that the form is on.
    Thet is a one to many relationship though. I need a way to tell the box that I al looking for information from table b(people) but filtered not by the record from table A the main form is on, but by the selection from table B that is highlighted in in the subform.

    I thought about using a "onclick" even on the subform but I don't know how to make the event tell the text box to show specific information.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    20,827
    Can you attach the db here? I'm not visualizing the setup.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Join Date
    Apr 2017
    Posts
    1,042
    You can have a look at form fMain2 in AssesmentObjetivesxample.accdb in zip-file I attached to post# 22 at

  6. #6
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    2,149
    The textbox in question is actually on the main form, not on the subform. Let's call it txtNotes. I assume Notes is a field in the subform's recordsource.

    So in the subform's on_current event:

    Me.Parent.txtNotes = [Notes]

    Clicking on different rows in the subform will fire the current event.

  7. #7
    noretoc is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2012
    Posts
    18
    Quote Originally Posted by davegri View Post
    The textbox in question is actually on the main form, not on the subform. Let's call it txtNotes. I assume Notes is a field in the subform's recordsource.

    So in the subform's on_current event:

    Me.Parent.txtNotes = [Notes]

    Clicking on different rows in the subform will fire the current event.
    You got it. This is more along the lines of what I was thinking but had no idea how to code it. I was sure it was something simple though. This solves a lot of different issues. I love you in a non-committal non-gender assuming purely platonic way. Thank you very much!

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

Similar Threads

  1. Replies: 5
    Last Post: 09-02-2016, 03:18 PM
  2. Button open selected record in subform table, in new form
    By BrainExplodingFromCoffee in forum Forms
    Replies: 4
    Last Post: 04-12-2016, 02:19 PM
  3. Replies: 16
    Last Post: 02-13-2016, 10:21 AM
  4. Replies: 9
    Last Post: 10-12-2011, 02:34 PM
  5. Replies: 1
    Last Post: 10-13-2010, 12:40 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
  •  
Tech Forums: Microsoft Office Forums