Results 1 to 4 of 4

Thread: Suppressing NotInList msg in ComboBox [** RESOLVED **]

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2003
    Posts
    114

    Suppressing NotInList msg in ComboBox [** RESOLVED **]

    Hi all.

    This one is bugging me ... I'm running Access 2000 and have a form that I want to allow adding of an account number thru the NotInList event of the combobox. That all works fine BUT! when I return from the routine that adds the acct # and refreshes the combobox the blasted default "Not in list " message still pops up even tho I have my own custom message box ... Any ideas of what I'm missing or got out of sequence?

    Here's my event procedure:



    PHP Code:
    Private Sub AccountComboBox_NotInList(NewData As StringResponse As Integer)
     
    Dim MsgVal As VbMsgBoxResult
        
        MsgVal 
    MsgBox(NewData " is not a recognized account number. Do you wish to add it?"vbYesNo"System Monitor")
        If 
    MsgVal vbYes Then
            Response 
    acDataErrAdded
            CheckThisAccountNumber 
    (NewData)
            
    NewData ""
            
    AccountComboBox_AfterUpdate
            
    Exit Sub
        
    Else
            
    AccountComboBox.SelStart 0
            AccountComboBox
    .SelLength Len(CustomerComboBox)
        
    End If
        
    Response acDataErrContinue
    End Sub 
    Thanks for taking a look ...

    - Mike
    Last edited by M Owen; Aug 1st, 2003 at 07:45 AM.

  2. #2
    Fanatic Member Matt_T_hat's Avatar
    Join Date
    Dec 2001
    Location
    '76 Male Body Evil-Errors: 666
    Posts
    774
    There are people who would very much like to know how you solved that one. I'm one such person.
    ?
    'What's this bit for anyway?
    For Jono

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2003
    Posts
    114
    Everyone! See my other related post on this subject ...

    http://www.vbforums.com/showthread.p...hreadid=255978

    - Mike
    Last edited by M Owen; Aug 6th, 2003 at 07:46 AM.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jun 2003
    Posts
    114
    UPDATE:

    Here is my updated NotInList method ... It works now ...

    PHP Code:
    Private Sub AccountComboBox_NotInList(NewData As StringResponse As Integer)
        
    Dim MsgVal As VbMsgBoxResultAcctID As Long
        
        MsgVal 
    MsgBox(NewData " is not a recognized account number. Do you wish to add it?"vbYesNo"System Monitor")
        If 
    MsgVal vbYes Then
            AcctID 
    CheckThisAccountNumber(NewData)
            
    Call FillTheAccountComboBox
            AccountComboBox
    .Value AcctID
            AccountComboBox_AfterUpdate
        
    Else
            
    AccountComboBox.SelStart 0
            AccountComboBox
    .SelLength Len(AccountComboBox)
            
    AccountComboBox.Text ""
            
    AccountComboBox.Value ""
        
    End If
        
    Response DATA_ERRCONTINUE
    End Sub 
    The change was not setting the Response value to DataErrAdded.
    The other significant properties of this combobox is that it's a Value List ... That also makes a difference. I'm not doing Requery actions on it ... I reconstuct the entire list with each NotInList item ...

    - Mike

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