Not In List help needed

T

Tara

I have the following code in a combo on my form:

Private Sub CboCustomer_NotInList(NewData As String, Response As Integer)
Dim strMsg As String

strMsg = "'" & NewData & "' is not currently in the list of businesses "
& vbCrLf & vbCrLf
strMsg = strMsg & "Do you want to add this business to the current list?"

If MsgBox(strMsg, vbQuestion + vbYesNo, "Add new business?") = vbYes Then
Response = acDataErrContinue

DoCmd.OpenForm "frmAddCustomer", , , , , acDialog
Response = acDataErrAdded

End If

End Sub

It works fine except for the fact that when I try to close frmAddCustomer,
my custom message repeats itself. If I choose No the 2nd time around (since
I JUST added the data), frmAddCustomer closes and the combo shows the new
data. Why does my message appear a 2nd time and how do I stop it?

Thanks!
 
C

Carl Rapson

Try taking out the line

Response = acDataErrContinue

and see if that makes a difference.

Carl Rapson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top