Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error msg when using NotInList property

Status
Not open for further replies.

dbanker

Technical User
Sep 26, 2007
30
US
Hello all,

Everytime i try to write an event procedure in the NotInList property of a combo box when I test it I get this error msg:

"The Expression On Not In List you entered as the event property setting produced the following error: A problem occurred while Microsoft Access was communicating with the OLE Server or ActiveX Control."

"* The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure]."

"* There may have been an error evaluating the function event or macro."

The code i have in the event procedure is as follows:

Private Sub ComboCompName_NotInList(NewData As String, Response As Integer)
Response = MsgBox("'" & NewData & "' is not recognized in the list. Please Check spelling " + Chr(13) & _
"or use the drop down box to enter name. If company name isn't in the list, please " + Chr(13) & _
"go to New Company form and enter it as a new company first", vbOKOnly)
End Sub


If anyone has some suggestions please help.
 
If response is an integer it's possible that the msgbox is returning a long datatype.

The early bird may get the worm, but the second mouse gets the cheese in the trap.
 
Response should be set to either acDataErrDisplay, acDataErrContinue or acDataErrAdded !


Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top