Results 1 to 2 of 2

Thread: DataCombo to insert in table if not there

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 1999
    Location
    Littlehampton, W Sussex GB
    Posts
    203

    Post

    Hi, I'm using a data combo drop-down to search an access table for a value which is then entered into the field on my database. It works great as when I type in the first few letters I get to those ones in the table.
    What I would like to do is if the user types in a value which doesn't exist, to ask them whether they want to add that value to the table and if yes, create another entry in the table I'm looking up. As well as populating the databae field.
    Any ideas? Thanks a lot.

  2. #2
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post

    Something like this?

    Code:
    if err.num= ## then ' use error that is returned when no record exists
       err.clr
       str= "The value you've entered does not exist, do you wish to add it?"
       rtn = msgbox(str, vbyesno)
       if rtn = vbyes then
          'call subroutine to add data into table
           datacontrol.refresh
       end if
    end if
    [This message has been edited by JHausmann (edited 08-20-1999).]

Posting Permissions

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



Click Here to Expand Forum to Full Width