Solved

Access limit to list default message

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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Office 365 home questions 7 65
Calculation in Access 5 26
Trying to force an answer in a combobox 7 18
Modify report 8 10
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
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 different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

803 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