• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 195
  • Last Modified:

Access limit to list default message

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
LisaPrice
Asked:
LisaPrice
  • 2
1 Solution
 
Rick_RickardsCommented:
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
 
LisaPriceAuthor Commented:
Thanks Rick, Now they can see my message instead of the Access default message.
0
 
Rick_RickardsCommented:
Indeed they can and a softer, gentler and more informitive message I'm sure it will be.
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now