Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    330
    Thanks
    10
    Thanked 0 Times in 0 Posts

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

    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
    "Heading for the deep end"

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

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

    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.
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    330
    Thanks
    10
    Thanked 0 Times in 0 Posts

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

    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
    "Heading for the deep end"

  4. #4
    Star Lounger
    Join Date
    Nov 2001
    Posts
    75
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    This MS Knowledge Base article should answer all your questions.

    <A target="_blank" HREF=http://support.microsoft.com/support/kb/articles/Q161/0/07.asp?LN=EN-US&SD=gn&FR=0&qry=q161007&rnk=1&src=DHCS_MSPSS_gn_ SRCH&SPR=ACC2000>http://support.microsoft.com/support/kb/ar...RCH&SPR=ACC2000</A>

    hth,
    Jack

Posting Permissions

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