|
-
February 17th, 2010, 02:21 PM
#1
Validation Event
HELP!
Not sure if there is a possible solution for this one but here goes.....
I have a form which is used for creating/editing invoices. The first control that gains the focus is a text box for the invoice number. The user has the option to enter an existing invoice number or press one of two buttons by the side of it ([New Invoice] and [Find Invoice]). There are an assortment of other controls on the form for the invoice details.
All Fine So Far.
The problem that I have is that I use the Validate event of the Invoice Number Text Box to check whether or not the invoice number entered is valid. I do not want the user to move to any of the other controls unless a valid invoice number is entered except for the Find Invoice and New Invoice Buttons. Within the Validate event I need to know which control the focus is trying to move to. The form ActiveControl property is still pointing to the invoice number text box as the focus does not move until after the Validate event completes.
Any Ideas?
-
February 17th, 2010, 06:50 PM
#2
Re: Validation Event
Get rid of that, and use the LOST FOCUS event, as well as the key presses (to track ENTER/TAB) and then do your own validation.
It will work better, because it will work the way that you WANT
-
February 18th, 2010, 12:56 PM
#3
Re: Validation Event
Thanks Dglienna, found solution, I didn't know that the CausesValidation event applies to the control that receives the focus so this does the job fine. I tried using the LostFocus event but that seems to interfere with the Click event of the button (button receives focus but no Click event fires).
-
February 18th, 2010, 06:33 PM
#4
Re: Validation Event
Trap what you need to.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|