Masked Edit Control Work-around help needed! 
Author Message
 Masked Edit Control Work-around help needed!

Quote:

> I have written a database program and need something similair to masked edit
> control, however I have learning edition (VB6.0), which does not allow this
> add-in. In particular I have a field in a recordset, and need to insure the
> data entered is in mm/dd/yy format.(or mm-dd-yy or mm/dd/yyyy etc)
> currently the program crashes if they enter mm.dd.yy or any other invalid
> date.
> (it crashes after validation when the database .update command is
> encountered.)

> It's not worth the $250 upgrade price just to get masked edit, as the rest
> of the program works fine in learning edition, surely there is a
> workaround...
> Thanks
> Bryan Norton

Why not sub-class the text control by using it as a constituent control on a
UserControl.  If VB 6.0 Learning Edition doesn't allow this (I don't know what
the difference is between the Learning and Pro. editions) the find VB 5.0
Control Creation Edition on the web somewhere and do it there.  I remember
seeing it somewhere about six months ago.  A web search should come up with
something.

___________________________
Matthew Harvell



Thu, 21 Jun 2001 03:00:00 GMT  
 Masked Edit Control Work-around help needed!
I have written a database program and need something similair to masked edit
control, however I have learning edition (VB6.0), which does not allow this
add-in. In particular I have a field in a recordset, and need to insure the
data entered is in mm/dd/yy format.(or mm-dd-yy or mm/dd/yyyy etc)
currently the program crashes if they enter mm.dd.yy or any other invalid
date.
(it crashes after validation when the database .update command is
encountered.)

It's not worth the $250 upgrade price just to get masked edit, as the rest
of the program works fine in learning edition, surely there is a
workaround...
Thanks
Bryan Norton



Fri, 22 Jun 2001 03:00:00 GMT  
 Masked Edit Control Work-around help needed!
Hi Bryan,

Here is a skeleton of date validation routine. you need to add checks for
validating the numbers to make sure they don't enter a date with 40 days or
something.

Private Function IsDateValid(ByVal sDateIn As String) As Boolean
    Dim bresult As Boolean

    If sDateIn Like "##/##/####" Then
        bresult = True
    ElseIf sDateIn Like "##/##/##" Then
        bresult = True
    ElseIf sDateIn Like "##-##-####" Then
        bresult = True
    ElseIf sDateIn Like "##-##-##" Then
        bresult = True
    End If

    IsDateValid = bresult

End Function

HTH

Andrew



Sat, 23 Jun 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Help needed with Mask edit control

2. need help on masked edit control

3. Need help with Masked Edit Control VB6...

4. Masked edit control not working right

5. Masked Edit Box and Control Masking

6. Need help with edit mask - urgently - please

7. Newbie needs help with edit mask - URGENTLY please

8. PLEASE NEED HELP: VB MASKED EDIT

9. Need Help With Masked Edit For Dates

10. Need Help with Mask Edit

11. need help on mask edit contol

12. Masked edit grief need help/advice

 

 
Powered by phpBB® Forum Software