?
Solved

Access limit to list default message

Posted on 2007-12-06
3
Medium Priority
?
191 Views
Last Modified: 2013-11-28
I want to limit a combo box to the list and use my own message instead of the default access message.  I can get my mesage and then the default message.  How do I turn off the access message?
Thanks
Lisa
0
Comment
Question by:LisaPrice
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
Rick_Rickards earned 750 total points
ID: 20422908
With your combo box, set the "Limit to List" property to Yes (this property can be found under the data tab.  If the first column's with is set to 0" this will automatically be changed to "Yes" for you.

Under the Events Tab add the following code to the combo boxes "Not_In_List" Event.   (See code snippet below).

Cancel = False turns off the Access Message
The line that starts off with MsgBox "Your Message" can be tailored to say whatever you'd like the user to see.  It's your message now.



Private Sub cboMyComboBox_NotInList(NewData As String, Response As Integer)
    Cancel = False
    MsgBox "The value you entered..." & vbCrLf & vbCrLf & _
           Space(5) & NewData & vbCrLf & vbCrLf & _
           "... was not found in the list." & vbCrLf & vbCrLf & _
           "Please try again", vbCritical, "Value not found"
End Sub

Open in new window

0
 

Author Comment

by:LisaPrice
ID: 20423224
Thanks Rick, Now they can see my message instead of the Access default message.
0
 
LVL 16

Expert Comment

by:Rick_Rickards
ID: 20423353
Indeed they can and a softer, gentler and more informitive message I'm sure it will be.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question