Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Oct 2004
    Location
    Minnesota, USA
    Posts
    151
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Syncing Form and Subform (Office 2003)

    I have a parent form with a combo box showing all customers and a subform that would then show various transactions with that customer. In this case, the form is intended to be used to update tickler information - the customers send us various pieces of information periodically. When something is received (the expected information is already there), the user would select the customer from the combo box. The subform would then show each open item with various fields to be completed such as date received, date of the information, any issues noted, etc.

    Here's my problem. I need the subform to open blank and be populated only after the user selects a customer. Do I create the subform unbound and use the "after update" propery of the combo box to run a query to populate it?

    The combo box is based off of information in a customer table and the subform after the tickler information table. The tables are related on the customer number field; the combo box displays the customer name. Field 0 in the combo box is the customer number.

    I know this is a basic issue, but I cannot remember how to do it.

    Any help will be appreciated.

    Thanks!

    Nancy

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Syncing Form and Subform (Office 2003)

    Is your main form bound to the customer table? It might be best to have an unbound main form, and to link the subform to the main form by the combo box value.

  3. #3
    2 Star Lounger
    Join Date
    Oct 2004
    Location
    Minnesota, USA
    Posts
    151
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Syncing Form and Subform (Office 2003)

    I got most of it to work - forms open empty and subform populates only with data from the selected customer. However, I have two follow up questions.

    1. How can I move the focus from the combo box on the parent form to a specific field in the subform? The code I have in the After Update event of the combo box is: Me.fsubAssnInfoInput.Form!txtDateReceived.SetFocus and it does not work. Focus stays on the combo box.

    2. How can I filter the subform so it only shows the open items? I've not worked with form filters applied to the OnOpen event of the form, which appears to be a likely place to put this one.

    Thanks!

    Nancy

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Syncing Form and Subform (Office 2003)

    1. You need two instructions, the first to set focus to the subform, the second to the control on the subform:

    Me.fsubAssnInfoInput.SetFocus
    Me.fsubAssnInfoInput.Form!txtDateReceived.SetFocus

    2. I'd create a query that selects the open items from the tickler table, and use the query as Record Source of the subform.

  5. #5
    2 Star Lounger
    Join Date
    Oct 2004
    Location
    Minnesota, USA
    Posts
    151
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Syncing Form and Subform (Office 2003)

    Perfect! Thanks so much for your help. I'm going to print this out so I remember next time.

    Nancy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •