>>>>>Does anyone have a sure solution to the VALIDATION OF A CONTROL OR CONTAINER?????
>>>>>
>>>>>
>>>>>TIA,
>>>>>Peter
[snip]
>For example I allow the blanking of my date field. If I used the embedded textbox control validation the moment I blanked a month but still had a day and a year the months Valid would return .f. because " /12/1997" is not a valid date. So instead I allow blank month, day, or year and check to see if they are all blank or all filled when focus is lost from the container.
---
If you allow all blanks OR all filled, but not *part* filled, try this:
1) When you enter the form, automatically fill the textboxes with a
reasonable date. (Say, the current date.)
2) If the user *changes* one textbox, do whatever normal validation
you'd want to do (making sure they don't enter 13 for the month, or
whatever)
3) If the user *blanks* a textbox, and then changes focus (as opposed to
blanking the box before typing something new) FORCE a blank of the other
two boxes:
txtmonth.LostFocus:
IF THIS.Value = ""
txtyear.Value = ""
txtday.Value = ""
ENDIF
I realize this doesn't let you attach your validation to the container,
but the only way I can think of doing that would be to create a method
that checks validation, and then call it frequently.
Hope this helps...
--Liz
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only