Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Database Design / July 2005

Tip: Looking for answers? Try searching our database.

Combo box - error message

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Patrick B - 27 Jul 2005 18:00 GMT
I have a combo box - I want to display an error message when the item entered
is not in the list.
I created an msgbox macro to display the text that will display.
In the Combo box properties list, I placed the macro name in the "on Not in
list " option.
I can run the macro by itself and it displays ok. But when I enter an item
not in the combo box list, it gives me no error message.
What am I doing wrong.

Pat

Signature

Pat

Ken Sheridan - 27 Jul 2005 18:45 GMT
You'll need to use code for this rather than a macro as you need to set the
return value of one of the NotInList event procedure's arguments.  Put
something like this in the event procedure:

Dim ctrl As Control
Dim strMessage As String

Set ctrl = Me.ActiveControl

strMessage = NewData & "is not in the list."
MsgBox strMessage, vbExclamation, "Error"
ctrl.Undo
Response = acDataErrContinue

> I have a combo box - I want to display an error message when the item entered
> is not in the list.
[quoted text clipped - 6 lines]
>
> Pat
tina - 28 Jul 2005 09:32 GMT
as well as following Ken's instructions for the VBA code, you have to set
the combo box's LimitToList property to Yes - or the NotInList event will
not run.

hth

> I have a combo box - I want to display an error message when the item entered
> is not in the list.
[quoted text clipped - 6 lines]
>
> Pat
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.