Results 1 to 3 of 3
  1. #1
    bundy75 is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2010
    Posts
    28

    Use combobox to control Subform

    I realise this question has been asked before but the answer haven't been able to figure it out.

    I have a form with a single combobox "Contact_Type" that is populated form a contact type table. The form also has a subform "Clients_Subform" that is to list all the clients with a particular contact type. Now my combobox defaults to the first contact type and the subform lists those clients.
    Two problems

    One: When I default the combo box to the second contact type the subform list still gets populated with the clients from the first contact type.

    Two:When I select a new contact type from the combobox nothing gets updated. For this I have tried new events in the afterupdate

    1 Me.Requery
    2 Me.Refresh
    3 Me![subform_name].Form.Requery
    4 Form![Main_form_name]![subform_name].Requery



    Nothing seems to work!!!!!!!!!!

    Thanks

  2. #2
    bundy75 is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2010
    Posts
    28
    Ok I see the problem

    The subform is based of my contact_type table so if I cycle through the records for my contact type table my subform updates as I expect

    New Problem

    How do I link my combobox to cycle through records???

  3. #3
    bundy75 is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2010
    Posts
    28
    Sorry for wasting your time but got it


    created the event procedure for combobox event "afterupdate"

    ' Find the record that matches the control.
    Dim rs As Object
    Set rs = Me.Recordset.Clone
    rs.FindFirst "[Contact_Type_Id] = " & Str(Nz(Me![Contact_Type_cb], 0))
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark

    now it works

    Thanks

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

Similar Threads

  1. Replies: 29
    Last Post: 08-16-2011, 05:52 PM
  2. Replies: 0
    Last Post: 08-24-2010, 06:38 PM
  3. Replies: 0
    Last Post: 12-16-2009, 01:14 PM
  4. Replies: 7
    Last Post: 05-24-2009, 10:24 AM
  5. Combobox synchronization in a subform
    By pe_z in forum Forms
    Replies: 0
    Last Post: 02-26-2006, 01:48 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