Solved

Access limit to list default message

Posted on 2007-12-06
3
187 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
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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…

792 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