On 26-Feb-05, at 6:09 PM, Lennox Jacob wrote:
If me.SelStart=0 then
aKey=Key
Return False ' This will save the first keypress
End if
If me.SelStart=1 and val(aKey+Key) >59 Then
Beep
Return True ' If the number is greater than 59 it will be blocked.
End If
that work beautifully on Mac,
It will not allow the user to enteranything greater than 59 bu on PC
it allows up to 99.
Since this part of the code was mine, I will respond.
You are absolutely correct. If you have a mask of "##" in windows it
doesn't even work. I will file a report as soon as I have tested
further.
For a 'Numbers Only' editfield I still prefer what I have done in the
past.
Set your editfield limit to 2 and use the following code.
Function KeyDown(Key As String) As Boolean
If (asc(Key)<32 and asc(Key)>48)or asc(Key)>57 then
Beep
Return True
End if
If me.SelStart=0 then
aKey=Key
Return False
End if
If me.SelStart=1 and val(aKey+Key) >59 Then
Beep
Return True End If
End Function
It works in both platforms and fixes the x,c and v problem in windows
as well.
This problem with "#" is also mentioned in the Language Reference. I
just didn't see it in action until I tested it again. It seems that one
"#" (from a previous test) is allowed but "##" thinks it's a Target
call.
There are some really screwed up things happening with mask there.
HTH,
Terry
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>
|