Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2012

    Unanswered: Requery Comb box

    Hi all
    I have a form w" ith a combo box "CboCustomer" it takes First name and last name and joins them together [FirstName]&" " &[Surname] if the name is not in the list I have a message box to tell them to select a button to add a new customer. press button and Customer form opens they add new customer and close form and return to CboCustomer but the new customer is not there to select. How would I get this to requery.

    Thanks Bob

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    You need to requery the combo box
    Where you issue that command is up to you.

    The easiest, and arguably simplist is to put a command button on the form which when pressed rins that code.
    The neatest is to do it automatically from the Customer form. That requires you to check if the other form is open and if so update the combo using
    you probably need wrap that code with an error handler, at the very least on error resume next to cater for the user entering cistomer data without the other form being open. You probably should requery after every insert in the customer form as you cannot guarantee how a user works with the customer form.

    Depends on your skill set. Personally i tend to use the simple press button to update approach as it makes each form standalone. Its easy enough to do it automatically but in my books it makes forms overly interdependent and can also be easier break.
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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