Combo Box Refresh -

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ggarz1
    New Member
    • Mar 2008
    • 5

    Combo Box Refresh -

    I am currently building forms for a party based business. I have a form in which a user enters data and creates a new "party" in the "party" table. All parties have a host, and that host must be a customer (a customer doesn't have to be a host). So I have a combo box to select the host from the current list of all customers. If the host of the party is not on the list, I have a second form open that allows the user to enter a new customer(into the customer table). How can I have the contents of the original party form's combo box refreshed when I update & close the "add new customer" form? BTW...I also would to use the "Add New Customer" and combo box within my order entry form. Thanks.
  • PianoMan64
    Recognized Expert Contributor
    • Jan 2008
    • 374

    #2
    What you're going to need to do is setup a requery of the combo box that has the customer list.

    When you get to that point and create the customer, then click the create customer button and the button opens the customer form. When you close back out of the customer form and the Focus of the form is back onto the Party form, then the Combo box is automaticly Requeried.

    [Code=VB]
    Private Sub CreateCustomer_ Click()
    DoCmd.OpenForm "Customer", acNormal
    End Sub

    Private Sub Form_Activate()
    Me.CustomerID.R equery
    End Sub
    [/code]

    Keep in mind that the "CreateCustomer _Click" is the routine that will open the customer form, you need to replace it with the Customer form name that you've created in place of the one that I have in Code, and then simply make sure that the Party form as the code snippit inside it and you're good to go.

    If you need any more help, let me know.

    Joe P.

    Comment

    • ggarz1
      New Member
      • Mar 2008
      • 5

      #3
      It worked like a charm. Thanks!

      Comment

      Working...