Limit to list

  • Thread starter Thread starter Tony Williams
  • Start date Start date
T

Tony Williams

I have a combobox with the limit to list set to Yes. However I want my own
message to appear and not the standard Access one. How can I stop the
standard one from appearing and add my own. I want to tell the user the
value is on the list they should choose "misc" and contact the system
administrator then click an OK button to take them back to the form. Can I
do this without the standard message coming up as well?
Tony
 
Hello.

Use the NotInList event:

Private Sub Field_NotInList(NewData As String, Response As
Integer)
MsgBox "This is MY message!"
Response = 0
End Sub
 
Tony Williams said:
I have a combobox with the limit to list set to Yes. However I want my own
message to appear and not the standard Access one. How can I stop the
standard one from appearing and add my own. I want to tell the user the
value is on the list they should choose "misc" and contact the system
administrator then click an OK button to take them back to the form. Can I
do this without the standard message coming up as well?

Tony,

1. Open the form in design view.
2. Open properties window and select the combo.
3. Click Events tab, then go to NotInList entry, click the small
button on the right. The code view will be displayed with these lines:

Private Sub Test_NotInList(NewData As String, Response As Integer)

End Sub

4. Set cursor between the two lines and write this:

'Tell Acess not to display standard message
Response = acDataErrContinue

'Display customized message in message box
MsgBox "My Message Text", vbOKOnly

HTH

Best regards
Emilia

Emilia Maxim
PC-SoftwareService, Stuttgart
http://www.maxim-software-service.de
 
Back
Top