PROBLEM CLOSING A USER FORM


Posted by Nick on March 06, 2001 9:14 AM

I have a user form which has a couple of text boxes. On exit of these boxes, my macro goes through a validation routine. The problem I have is that if the "user" clicks on a "Cancel" button before entering any data then the macro still drops in the exit routine. How can I get it to drop first in to the Cancel routine or either to test to see if the user has clicked on the cancel button. The start of my macro is:

"Private Sub TxtLia01_Exit(ByVal Cancel As MSForms.ReturnBoolean)"

but whatever I do Cancel is always equal to "false".



Posted by Dave Hawley on March 06, 2001 9:33 AM

Hi Nick

The Cancel in a Textbox is used to prevent a user from leaving the control. For your purposes why not use a Boolean variable and run a quick check on it when the Cancel button is clicked.


Dave
OzGrid Business Applications