Consulting

Results 1 to 4 of 4

Thread: Solved: Add record in Sub Form, not available in Main Form

  1. #1

    Solved: Add record in Sub Form, not available in Main Form

    Hi everyone,

    I hope this is a clear description of where I seem to have a problem.

    Main form has drop-down to select a CUSTOMER.
    Main form also has sub-form to maintain / add new customers.

    When I add a new Customer on the Sub-Form, it doesn't appear in my drop-down unless I close the form and re-open.

    Is there a way to get an 'immediate' visibility of newly added CUSTOMERS?

    Thanks
    Michael

  2. #2
    Yep! In VBA, you need to call the Requery method of the Form object. Simply place the line "NameOfMainForm.Requery" at the end of any applicable code or event that alters data from the table, and you should be all set.

  3. #3
    Cheers chocobochick, I'll give it a try.

    BR
    MIchael

    PS luv the name

  4. #4
    Correction: Upon rereading your original message, I realized you only need to requery the control, not the form. In this case, your code should probably read "NameOfMainForm.NameOfComboBox.Requery".

    P.S. Thanks. My typical username in various forums has usually been chocobochicken. However, VBX only accepts 12 letters in a username, truncating it to chocobochick, which is somewhat unfortunate as it can potentially lead to misinterpretations of my gender. Oh, well.

Posting Permissions

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