Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    490
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I am tring to modify a combo not in list procedure. Basically if the item is not in the list then I want to put the new item into a textbox, and not add it to the table the combo is bound to until later in the program. I have tried the code below but still get messages "The item entered is not in the list", "The record cannot be saved at this time"

    Any ideas how I can defer a not in list item? Thanks

    Private Sub Combo2_NotInList(NewData As String, Response As Integer)
    Dim db As DAO.Database, rst As DAO.Recordset, SQL As String, TP As Long

    Response = False

    If MsgBox("The Folder " & UCase(NewData) & " does not exist. Create it?", vbYesNo) = vbYes Then

    Me.PF = Me.Combo2 ' Just put the users typed in name into a textbox

    Response = acDataErrAdded
    DoEvents

    Else
    Response = acDataErrContinue

    End If

    End Sub

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Try something like this:

    Code:
    Private Sub Combo2_NotInList(NewData As String, Response As Integer)
      Me.txtOther = NewData
      Me.Combo2.Undo
      Response = acDataErrContinue
    End Sub
    where txtOther is the name of the text box that you want to fill.

  3. #3
    4 Star Lounger
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    490
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Many thanks yet again, your suggestion works perfectly. Best regards

Posting Permissions

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