Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Replace microsoft forms message box with something more meaningful
Hi
I have a userform with a combobox whos "match entry" property is set to True. If the user enters invalid text they get a microsoft forms message saying invalid property value. How do I change the message to something more meaningful. I would be grateful for any help Kenny W XP pro and Office 2003 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Replace microsoft forms message box with something more meaningful
On Fri, 18 Jul 2008 20:30:14 +0100, "Forum Freak"
wrote: I have a userform with a combobox whos "match entry" property is set to True. If the user enters invalid text they get a microsoft forms message saying invalid property value. How do I change the message to something more meaningful. There is not built in way to change that message. I have an alternate suggestion. Change the Style property from Combo to DropDown. That will prevent the user from entering invalid characters and obviate the need for a message. If you still want to roll your own, you'll need to set MatchEntry to False, then use the Change event to cycle through the list to determine when an invalid character is entered. Unfortunately, Excel doesn't have a NotInList event like Access. If you like, I can write some basic Change event code that will get you started. -- Dick |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Replace microsoft forms message box with something more meaningful
Thanks for looking at this one Dick
The problem occured after I changed the Style from Combo to list! Under normal circumstances the messagebox never occurs however I can evoke the bug in the following manner. There is a command button on the userform which when clicked clears all the text boxes and comboboxes. After this has been used it is possible to select the comboboxes whos style is set to list rather than combo. If you single click the empty box but dont do anything else , then click in another box or button you get the dreaded "invalid property value" message. This locks everything until you enter correct details into the List type boxes. This is ok as ultimately this is what I want however some users will not understand what to do, hence the need for a user friendly message. I currently have a label on the userform displaying what to do in the event of... however it smacks of unprofessionalism. Thanks for the offer of writing some code but I will decline for now. Whilst writing this I have just thought perhaps I should change the code behind my clear button. I wonder if not clearing these two boxes or replacing the text to something within the list will cure the bug? Thanks for your continued assistance over the years. Regards Kenny "Dick Kusleika" wrote in message ... On Fri, 18 Jul 2008 20:30:14 +0100, "Forum Freak" wrote: I have a userform with a combobox whos "match entry" property is set to True. If the user enters invalid text they get a microsoft forms message saying invalid property value. How do I change the message to something more meaningful. There is not built in way to change that message. I have an alternate suggestion. Change the Style property from Combo to DropDown. That will prevent the user from entering invalid characters and obviate the need for a message. If you still want to roll your own, you'll need to set MatchEntry to False, then use the Change event to cycle through the list to determine when an invalid character is entered. Unfortunately, Excel doesn't have a NotInList event like Access. If you like, I can write some basic Change event code that will get you started. -- Dick |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Replace microsoft forms message box with something more meaningful
On Wed, 23 Jul 2008 22:43:15 +0100, "Forum Freak"
wrote: There is a command button on the userform which when clicked clears all the text boxes and comboboxes. After this has been used it is possible to select the comboboxes whos style is set to list rather than combo. If you single click the empty box but dont do anything else , then click in another box or button you get the dreaded "invalid property value" message. This locks everything until you enter correct details into the List type boxes. You're right, that's exactly how it works. How silly. It appears that if you change MatchRequired to False, you can avoid this problem. If the Style is still DropDown, the user can't enter anything that's not on the list. So it seems that MatchRequired does nothing (other than cause errors) if the Style is DropDown. Thanks for the offer of writing some code but I will decline for now. Whilst writing this I have just thought perhaps I should change the code behind my clear button. I wonder if not clearing these two boxes or replacing the text to something within the list will cure the bug? Yeah you don't need any code, I misunderstood the question. Try changing Match Required to False and see if that gives you better behavior, even if it's not exactly what you may want. -- Dick |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Replace microsoft forms message box with something more meaningful
Thanks for continuing with this thread.
As I was hell bent on stopping users screwing up the database I would have never considered setting MatchRequired to False! Needless to say I have tested it on my spreadsheet and it works. Thanks again Kenny "Dick Kusleika" wrote in message ... On Wed, 23 Jul 2008 22:43:15 +0100, "Forum Freak" wrote: There is a command button on the userform which when clicked clears all the text boxes and comboboxes. After this has been used it is possible to select the comboboxes whos style is set to list rather than combo. If you single click the empty box but dont do anything else , then click in another box or button you get the dreaded "invalid property value" message. This locks everything until you enter correct details into the List type boxes. You're right, that's exactly how it works. How silly. It appears that if you change MatchRequired to False, you can avoid this problem. If the Style is still DropDown, the user can't enter anything that's not on the list. So it seems that MatchRequired does nothing (other than cause errors) if the Style is DropDown. Thanks for the offer of writing some code but I will decline for now. Whilst writing this I have just thought perhaps I should change the code behind my clear button. I wonder if not clearing these two boxes or replacing the text to something within the list will cure the bug? Yeah you don't need any code, I misunderstood the question. Try changing Match Required to False and see if that gives you better behavior, even if it's not exactly what you may want. -- Dick |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
replace VBA run-time error message with custom message | Excel Programming | |||
Replace Excel Message w/Custom Message | Excel Programming | |||
Intercept/replace standard 'cell protected' message with my own message? | Excel Programming | |||
Overwriting error message #NUM! with meaningful text | Excel Discussion (Misc queries) | |||
Microsoft Forms | Excel Discussion (Misc queries) |