refresh combo box control

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • barkarlo
    New Member
    • Nov 2006
    • 59

    refresh combo box control

    I have two forms frmworkshop and frmcustomers
    In form frmworkshop between others I have combo box control with customers.
    Also in form frmworkshop I have one command button with name "new customers".
    When I click on command button I open form frmcustomer and then I write
    new customers. After close frmcustomers in combo box control of frmworkshop
    I see new customers record and it is ok. But,if I want a write new customer
    again after close frmcustomers I can't see new customer record.
    How can I write code who will refresh combo box control on frmworkshop.
  • puppydogbuddy
    Recognized Expert Top Contributor
    • May 2007
    • 1923

    #2
    Originally posted by barkarlo
    I have two forms frmworkshop and frmcustomers
    In form frmworkshop between others I have combo box control with customers.
    Also in form frmworkshop I have one command button with name "new customers".
    When I click on command button I open form frmcustomer and then I write
    new customers. After close frmcustomers in combo box control of frmworkshop
    I see new customers record and it is ok. But,if I want a write new customer
    again after close frmcustomers I can't see new customer record.
    How can I write code who will refresh combo box control on frmworkshop.
    If I understood you correctly, your form opens in edit mode instead of data entry mode. If that is the case, replace the existing open form statement in your code with this one.

    DoCmd.OpenForm "frmcustome rs", , , ,acFormAdd

    Comment

    • barkarlo
      New Member
      • Nov 2006
      • 59

      #3
      Originally posted by puppydogbuddy
      If I understood you correctly, your form opens in edit mode instead of data entry mode. If that is the case, replace the existing open form statement in your code with this one.

      DoCmd.OpenForm "frmcustome rs", , , ,acFormAdd
      I want automatic refresh inserted record in form frmcustomers to combo box control in frmworkshop.
      When I insert new record in form frmcustomer and close him I must close
      and open form frmworkshop how can I see new record in a combo box control.

      Comment

      • puppydogbuddy
        Recognized Expert Top Contributor
        • May 2007
        • 1923

        #4
        Originally posted by barkarlo
        I want automatic refresh inserted record in form frmcustomers to combo box control in frmworkshop.
        When I insert new record in form frmcustomer and close him I must close
        and open form frmworkshop how can I see new record in a combo box control.
        There is more than one way to do it. It would have been helpful if you had posted your code in which you open frmworkshop, If the code below does not work the way you want, please post the code that you have.

        Nonetheless, here is one way that you can do it if in your code, you automatically go to frmworkshop everytime frmcustomers is closed. Since both forms have to be open in order to pass commands/parameters between one and the other....put this code with the code in frmCustomers from which you open frmworkshop as illustrated below.

        in form frmCustomers
        Code:
        --------------------------------
        any save code that you for changes to frmCustomers 
        Me.Refresh
        DoCmd.OpenForm "frmworkshop".................
        DoCmd.Close acForm, "frmcustomers" 
        
        in the Form_Open event for frmworkshop:
        -----------------------------------------------------------
        
        Me.YourCombobox.Requery

        Comment

        Working...