Solved

Access limit to list default message

Posted on 2007-12-06
3
178 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
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
Rick_Rickards earned 250 total points
Comment Utility
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
Comment Utility
Thanks Rick, Now they can see my message instead of the Access default message.
0
 
LVL 16

Expert Comment

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

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now