Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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
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
VB's Command Button vs Form's Command Button Ronald Dodge Excel Programming 3 May 24th 06 02:23 PM
Is there a 'GetKeys' or equivalent? Zakynthos Excel Programming 4 October 31st 05 09:17 PM
Equivalent Of VAL davidm Excel Programming 4 July 27th 05 06:22 PM
I need the equivalent formula for this UDF Don[_18_] Excel Programming 3 September 8th 04 04:05 AM
VB's equivalent to VLOOKUP? Dan Excel Programming 4 June 9th 04 08:47 PM


All times are GMT +1. The time now is 11:03 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"