Results 1 to 4 of 4
  1. #1
    whojstall11 is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Sep 2011
    Posts
    57

    New Entries to a Combo box

    I want to be able to add new entries to my comb box. How can I do this?

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    There are several ways.... are you using a value list or is the data in a table? I generally use a table, unless the values are something that rarely changes (days of the week, months, etc)

    Here is one way: http://allenbrowne.com/ser-27.html (see option 4 if using a value list)

    Another: http://access.mvps.org/access/forms/frm0015.htm

    And another: http://www.fontstuff.com/access/acctut20.htm

    Or Google: access "not in list"

  3. #3
    whojstall11 is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Sep 2011
    Posts
    57
    Wow i tried a code like this and it didnt work but this just so happen to have worked this time thank you.
    Code:
    Private Sub CategoryID_NotInList(NewData As String, Response As Integer)    Dim strTmp As String        'Get confirmation that this is not just a spelling error.    strTmp = "Add '" & NewData & "' as a new product category?"    If MsgBox(strTmp, vbYesNo + vbDefaultButton2 + vbQuestion, "Not in list") = vbYes Then            'Append the NewData as a record in the Categories table.        strTmp = "INSERT INTO Categories ( CategoryName ) " & _            "SELECT """ & NewData & """ AS CategoryName;"        DBEngine(0)(0).Execute strTmp, dbFailOnError                'Notify Access about the new record, so it requeries the combo.        Response = acDataErrAdded    End IfEnd Sub

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Great!!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Multiple Entries
    By alyon in forum Access
    Replies: 2
    Last Post: 05-15-2012, 07:45 AM
  2. Entries made to Combo Boxes
    By jparker1954 in forum Access
    Replies: 6
    Last Post: 08-23-2011, 05:46 PM
  3. Multiple entries
    By Ziggy-R in forum Access
    Replies: 11
    Last Post: 10-03-2010, 07:42 PM
  4. Y and N entries
    By Drisconsult in forum Access
    Replies: 4
    Last Post: 08-10-2010, 02:16 PM
  5. Replies: 3
    Last Post: 05-25-2010, 02:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums