Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2011

    Unanswered: Select item in a list2 based on selection in list1 and retain focus in list1

    Trying to learn Access. Using VB.

    I have a form with a list of items from table1 and another list of items from table2. They have an ID field in common with a 1-many relationship. Both tables have less than 5 rows.

    Items in List1 are ordered by SubID, items in list2 are ordered by ID.

    In the form OnLoad event, I select the first row of List1.

    Need help with what needs to happen next.

    I want to determine the corresponding ID of the selected row in List1 and find and select that item in List2, then move focus back to List1

    For List1
    Row Source Type: is Table/Query
    Row Source: Select T1.SubID, T1.ID, T1.Name From T1 ORDER BY T1.SubID

    Similarly for List2

  2. #2
    Join Date
    Apr 2005
    Zagreb - Croatia
    Look at "DemoList1List2ComboA2000.mdb" (attachment, zip).
    Look at Tables, Form1(VBA), Relationships.
    Open form and try.
    I thin you need something like this.
    I forgot,
    Put Sub List2_AfterUpdate, and put the code:
    Attached Files Attached Files
    Last edited by MStef-ZG; 10-14-11 at 09:46.

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