A little...let me try to explain in further detail using my current project.
The database is for a non-profit historical society and is primarily geared toward keeping track of the contact for the organization.
They have a contact and that contact can be affiliated with the database owner in many ways. For example, they may be a school administrator, a business owner, a volunteer or a government official.
The premise is that once that business or school is already entered, all you have to do is link this particular contact with that business or school.
What I have done is offer the users a form that allows them to associate a contact with a affiliate.
If the affiliate exists, the table stores their key so that mail merge and other resource can identify who is connected to whom.
If however, the affiliate is brand new, when the user tries to type the new name in the box I want to take them to the affiliate form (open form...acNew) and let them add ALL of the information required.
When that form is completed and saved, it will return the to the previous form (and select that affilitate for them).
Essentially I am updating the combo box with a new record, BUT I want to do more than just add one piece of information about that record.
I know how to do all of that (and have many times under different circumstances) but I normally tell the users..
"If the value isn't in the box, "double click the control" and it will open a form to let you add a new record for that field"
What I am trying to do is eliminate the need to double click the combo box and automatically offer the user a yes/no question base on the fact that they typed something 'not in the list'
Here is a sample of the code that I am using:
'''''''''''''''''''''''''''''''''''''''''''''
Private Sub cboName_NotInList(NewData As String, Response As Integer)
On Error GoTo Err_cboName_NotInList
Dim intResponse As Integer
intResponse = MsgBox("You have entered a value that is not recognized. Do you want to add a new value?" & Chr(13) & _
"If you feel that the value may exist answer NO, and search again, otherwise press YES." & Chr(13) & _
"NOTE: Duplicate values will not be permitted.", vbQuestion + vbYesNo, "Unrecognized Name"
Select Case intResponse
Case 6 'vbyes
'open the form (typically a pop up) and let them add a new affiliate
Case Else 'vbno
Exit Sub
End Select
Err_cboName_NotInList:
Select Case Err.Number
Case 0
Err.Clear
Case Else
MsgBox Err.Number & " " & Err.Description
End Select
''''''''''''''''''''''''''''''''''''''''''''''''''''
THis part all works fine, but when the user chooses an answer to my inquiry the Access message box follows and GUMS UP THE WORKS!
Hence my original question: Is there a way to prevent the default message from appearing?
by the way... what is err.number=0 mean?
Hope this makes more sense of what I am trying to do, and thanks again for the help.
JerseyBoy
Remember: self-praise is no recommendation