Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Equivalent to vb's causes validation?
I am performing some validation on the Exit method of a
combo box. However, when user selects the Cancel button, I don't wish to perform the validation. In VB there is a button property called Causes Validation which you can set to false. Is there anything in VBA? Is my validation code in the right sub? Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Equivalent to vb's causes validation?
VBA controls do not have Validation event or a CausesValidation property.
The Exit event of a VBA combo gives pretty much the same functionality as VB's validation event, in both you can set Cancel = true to prevent focus leaving the control. Despite those differences, I don't see how you'd handle things differently in VB vs VBA. If you know in advance you won't need to validate then skip the code in the Exit event. You'd have just as much opportunity to do that as you would to change the CausesValidation flag. However if the combo has focus you don't know until the Exit (or VB's validate) event has completed if user pressed a cancel button. You would be able to detect if user pressed the little X (queryClose event) or pressed escape (combo keydown keycode = vbKeyEscape) and set a flag to abort the Combo's exit code. Regards, Peter T "dman" wrote in message ... I am performing some validation on the Exit method of a combo box. However, when user selects the Cancel button, I don't wish to perform the validation. In VB there is a button property called Causes Validation which you can set to false. Is there anything in VBA? Is my validation code in the right sub? Thanks. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Equivalent to vb's causes validation?
"Peter T" <peter_t@discussions wrote in message ... ...However if the combo has focus you don't know until the Exit (or VB's validate) event has completed if user pressed a cancel button. Regards, Peter T Well that is what I am trying to do. I have a canel button on the form along with 3 combos. If the user hits the cancel button, is there a way to bypass the Exit event of which ever combo box had focus? Thanks. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Equivalent to vb's causes validation?
I guess I'll just remove the cancel button and trap the
query close event. Thanks. "dman" wrote in message ... "Peter T" <peter_t@discussions wrote in message ... ...However if the combo has focus you don't know until the Exit (or VB's validate) event has completed if user pressed a cancel button. Regards, Peter T Well that is what I am trying to do. I have a canel button on the form along with 3 combos. If the user hits the cancel button, is there a way to bypass the Exit event of which ever combo box had focus? Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VB's Command Button vs Form's Command Button | Excel Programming | |||
Is there a 'GetKeys' or equivalent? | Excel Programming | |||
Equivalent Of VAL | Excel Programming | |||
I need the equivalent formula for this UDF | Excel Programming | |||
VB's equivalent to VLOOKUP? | Excel Programming |