Thanks Mike, but the issue is getting the variable control to autoselect when I set focus to it via property.  Validation is not the problem.  I did try defining the variable as text (in addition to integer), but it still fails to autoselect.  BTW, Variable Edit Properties "Enabled" and " Autoselect" are checked and Maximum Length is set to 2, although I did try 3 and 4 just for the heck of it.

As a matter of fact, Autoselect seems to work only when tabbing into a field, not when mouse-clicking into it.  So the autoselect property is equivalent a mouse click, rather than tab?

[ponder, test...]

Aha!  Got it.  It's setting vIndBirthMM to null that prevents the field from autoselecting.  If I don't null the variable, it autoselects properly.

Here's the modified code in the On Exit eep:
IF vIndBirthMM > 12 THEN
   PAUSE 2 USING 'Invalid Month' +
     CAPTION 'caption' Button 'OK'

   -- SET V vIndBirthMM = NULL
   PROPERTY BirthMM SET_FOCUS 'true'
   --PROPERTY BirthMM autoselect 'TRUE' *(Not needed if autoselect property is checked)
ENDIF

RETURN

Thanks for the direction Mike.
Doug


MikeB wrote:
Any reason you can't collect the date information in 3 fields of type text and
then validate it to your hearts delight?


----- Original Message ----- 
From: "Doug Hamilton" <[EMAIL PROTECTED]>
To: "RBG7-L Mailing List" <[email protected]>
Sent: Monday, March 07, 2005 11:24 AM
Subject: [RBG7-L] - Re: Can't get AutoSelect Property to work


  
Thanks Bernie, I wish it were that easy.  Some people prefer not to give
a birth year, so I need to store the month and day with a dummy year -
I'm going to use 1000.  Granted, the user could key in the 1000 for
those birthdates for which there is no year, but I prefer to do that
programmatically as a step towards "user friendly" - the fewer
exceptions and special cases the user has to remember, the better.  I'll
be using the same logic for anniversaries.

I think Tom Hawley's idea of a Variable Precision Date, VPDate, datatype
has merit and second his suggestion.

BTW, there was an obvious error in my original post: "So the first error
check is to make sure user enters an invalid month".  No problem with
them doing that; it should have read "..make sure user enters a
_valid_  month."

Doug

Bernard Lis wrote:

    
Doug,
Why can't you use:  set var birth = (getdate('Enter Birth Date'))
Then they can't enter an invalid date.
But you should check for '[Esc]'

Bernie Lis

----- Original Message ----- From: "Doug Hamilton" <[EMAIL PROTECTED]>
To: "RBG7-L Mailing List" <[email protected]>
Sent: Monday, March 07, 2005 12:27 AM
Subject: [RBG7-L] - Can't get AutoSelect Property to work


      
I'm working on Date with Year Optional issue for which several people
have offered very helpful suggestions.  I'll post the final results
soon.

Part of the effort is to make it goof-proof (yeah, right).  I'm
collecting the month, day and year in separate varialbles and then
RDATEing them into a valid date. So the first error check is to make
sure user enters an invalid month.  If an invalid month is entered (>
12 at this time), I do a Pause error message and then set focus on
the month variable control for re-entry.  I would also like to have
it Autoselect, as it does when user first tabs into it, so user
doesn't have to delete the null symbol.  But I can't get the
Autoselect property to work.  The following code is in an On Exit eep
for the birth month variable control;  vIndBirthMM is the integer
variable defined before the form starts, BirthMM is the componentID.
Autoselect is checked on the properties.   I have also tried putting
the Autoselect before the Set_Focus with no luck and tried moving the
Autoselect to an On Entry eep, again with no luck.  Any ideas?

IF vIndBirthMM > 12 THEN
   PAUSE 2 USING 'Invalid Month' +
     CAPTION 'caption' Button 'OK'

   SET V vIndBirthMM = NULL
   PROPERTY BirthMM SET_FOCUS 'true'
   PROPERTY BirthMM autoselect 'TRUE'
ENDIF

RETURN

Thanks much.
Doug
p.s.  Version 80.30228
        

Reply via email to