Results 1 to 5 of 5
  1. #1
    rosh41 is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2010
    Posts
    10

    Exclamation Sync ListBox?

    Hi, I'm struggling my #$@ off for 3 weeks now!! I have two tables: TrainingConducted and TrainingHistory which is related one-to-many through a TrCost_ID(Key).


    That tables is represented in two forms - TrainingConducted and TrainingHistory. I want to populate a listbox with JUST the values where the TrCost_ID in TrainingConducted = TrCost_ID in TrainingHistory. Currently the listbox is filled with ALL the values in the TrainingHistory table.
    Also,I want the Listbox to update in conjucntion with me moving through the records in the TrainingConducted table.

  2. #2
    is49460 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2010
    Posts
    40
    what does your row source for the listbox looks like now? (if you can just post sql)

    second part: you would create an event "after update" that would redefine listbox rowsource with the criteria where trcost_id = trcost_id of the selected record

    let me know if you need a more detailed help

  3. #3
    rosh41 is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2010
    Posts
    10

    Another description...

    Hi, Attached is two sheets explaining what I'm struggling with. View1 shows a combobox which sums up all courses conducted.
    View2 must show all the attendees booked for each course, based on the selection in View1's combobox.
    This is based on records in Tbls TRAINING_CONDUCTED & TRAINING_HISTORY.

    Attachment 1243

    Attachment 1244

  4. #4
    is49460 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2010
    Posts
    40
    Create AfterUpdate event for the CoursesConducted combobox. Put a line of code to change rowsource of the Attendees combobox, something like this:

    me.cboAttendees.rowsource = "Select AttendeesID from Training_History Where TrCost_Id = " & Me.cboCourses

    cboAttendees - the name of the combobox with Attendees info
    AttendeesID - field of what you want to display in Attendees combobox, you can add more than 1 field here if needed
    Tr_Cost_Id - primary key that will be matched to the current selection in your courses combobox, assuming that value item returned by it is Tr_cost_ID
    cboCourses - combobox for courses.

    Change all the names in the code as described above. Should do the trick, let me know if still stuck

  5. #5
    rosh41 is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2010
    Posts
    10
    Thanks a lot!! Problem solved.
    I don't however know how to mark this as 'Solved'.

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

Similar Threads

  1. Replies: 30
    Last Post: 06-26-2011, 10:47 PM
  2. How do I get data from a listbox?
    By cowboy in forum Programming
    Replies: 1
    Last Post: 06-15-2010, 02:28 PM
  3. Unattended Sync
    By frowsyone in forum Access
    Replies: 1
    Last Post: 05-26-2010, 04:48 AM
  4. Sync table and file in access
    By erlan501 in forum Import/Export Data
    Replies: 1
    Last Post: 04-30-2010, 02:12 PM
  5. Split Form Sync up
    By jonsuns7 in forum Forms
    Replies: 1
    Last Post: 11-10-2009, 02:56 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