|
-
Jul 28th, 2003, 01:16 PM
#1
Thread Starter
Lively Member
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 String, Response 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.
-
Aug 5th, 2003, 08:21 AM
#2
Fanatic Member
There are people who would very much like to know how you solved that one. I'm one such person.
-
Aug 6th, 2003, 07:40 AM
#3
Thread Starter
Lively Member
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.
-
Aug 6th, 2003, 07:51 AM
#4
Thread Starter
Lively Member
UPDATE:
Here is my updated NotInList method ... It works now ...
PHP Code:
Private Sub AccountComboBox_NotInList(NewData As String, Response As Integer)
Dim MsgVal As VbMsgBoxResult, AcctID 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|