• Add new item to table behind combo list (97 sr2 on 95b)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Add new item to table behind combo list (97 sr2 on 95b)

    Author
    Topic
    #363739

    I have a NewJob form that has a combo box related to a customer table on it.
    Obviously, when a new job is created, the relevant customer is selected from the list.

    If a new customer is typed into the combo box, a message appears saying “The text you entered isn’t an item in the list.”

    How do I trap this error so that a msg box appears asking, “Do you wish to add a new customer?”
    On yes, I want the newCustomer form to open so that the details can be entered, then when closed and the NewJob form regain the focus, cause the combo box to requery the underlying table so that the new customer is included.

    I know how to do the msg box to trigger the NewCustomerform but not how to trigger it. I would think via an error message but what error and in what event?

    I understand the getfocus event for the form but not how to do the combo requery.

    Thanks to all who look at this for me.

    Regards, Allan

    Viewing 0 reply threads
    Author
    Replies
    • #555963

      Hi Allan,
      You want the NotInList event of the combobox to trigger your code. You can look it up in the Help menu or do a search for NotInList in this forum and you should get some samples.
      If you need any more help, please repost.

      • #555967

        Thanks Rory, The not in list function allows me to get the NewCustomer box up ok.

        I still get the “Text not an item in list” message, is there a way to suppress this”

        Also, can you help with the requery if the combo box data so that I don’t have to close the NewJob form and reopen it in order for the new customer to show.

        Allan

    Viewing 0 reply threads
    Reply To: Reply #555967 in Add new item to table behind combo list (97 sr2 on 95b)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information:




    Cancel