Limit to list

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
 
I

Ivar Svendsen

Hello.

Use the NotInList event:

Private Sub Field_NotInList(NewData As String, Response As
Integer)
MsgBox "This is MY message!"
Response = 0
End Sub
 
E

Emilia Maxim

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
 

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