Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default Better error message when a user enters a value in a form comboboxthat is not valid

Hi All

I have a form with a combo box that lists valid choices and has "Match
Required" = true.

If a user ignores the pull down on the combo box and enters invalid
data all they get when done is a message saying "Invalid property
value". I cannot see a way of overriding this message like you can do
with cell validation. This message of course meaans nothing to a
normal user and they get very confused.

What is the best way to handle this?

Chrisso?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default Better error message when a user enters a value in a formcombobox that is not valid

On 31 Aug, 09:57, Chrisso wrote:
Hi All

I have a form with a combo box that lists valid choices and has "Match
Required" = true.

If a user ignores the pull down on the combo box and enters invalid
data all they get when done is a message saying "Invalid property
value". I cannot see a way of overriding this message like you can do
with cell validation. This message of course meaans nothing to a
normal user and they get very confused.

What is the best way to handle this?

Chrisso?


The solution I have implemented runs as follows:


' stop users typing text into the reason combo box as some user think
they can enter what they like in here
' and then get confused when Excel says "Invalid Property Value"
Private Sub cbxReason_Change()
' jump out if user clears the combo box
If IsNull(Me.cbxReason) Then Exit Sub
If Me.cbxReason = vbNullString Then Exit Sub
' exit if a value is entered via the pull down and appears in the
the combo box row source - a range name of allowable values:
If Value_In_Range_Name_List("REASON_CATEGORIES",
Me.cbxReason.Value) Then Exit Sub

' stop users entering garbage in this combo box before they get a
useless Excel message:
Me.cbxReason = Null
MsgBox "Please use the pull down.", vbExclamation, "Hint"
End Sub

Public Function Value_In_Range_Name_List(sListName As String, sValue
As String) As Boolean
Value_In_Range_Name_List = Not
ThisWorkbook.Names(sListName).RefersToRange.Cells. Find(sValue, ,
xlValues, xlWhole) Is Nothing
End Function

Hope this helps others or spurs someone to show me a better solution.

Chrisso
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i add an error message if someone enters wrong data Mike Excel Discussion (Misc queries) 3 September 29th 09 03:30 PM
Not a valid add-in error message? anna Excel Programming 0 August 4th 06 07:27 PM
Error Message: "xis is not a valid Win32 application" stranchina Excel Discussion (Misc queries) 0 August 21st 05 01:28 PM
Pivot Table not valid error message when formatting data 'button'. MDW Excel Discussion (Misc queries) 0 January 27th 05 03:01 PM
Not a valid Add-in - Error Message Stuart[_5_] Excel Programming 3 October 4th 04 07:07 PM


All times are GMT +1. The time now is 04:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"