Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2004

    Unanswered: problem with maskedit in vb

    hi every1
    i am using vb and sql server i am using mskeditbox for session i.e"2000_2001" now i want to impose a constraint that year left to the "_" must be less than the year right to the "_" so how to do it?
    n my sec problem is that i have mskedit box for e_mail address now i want to use "@" and "." in it but there must be only one of both they cannot be at the start of address and "." must be after the "@" plz solve my problems

  2. #2
    Join Date
    Mar 2004

    Re: problem with maskedit in vb

    Put this code in the KeyPress Event of the MaskedEditBox:

    If KeyAscii = 13 Then 'If User pressed Enter

    if Left(MaskedEditBox,4)>Right(MaskedEditBox,4) Then

    MsgBox "Right year must be greate then left year."


    MsgBox "Entry Accepted."

    End If

    ElseIf KeyAscii <> 8 And (KeyAscii < 48 Or KeyAscii > 57) Then
    'If user tries to enter a non-numeric charcter stop the entry
    KeyAscii = 0
    End If

    Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

    Or try our Ask An Expert service to answer any of your questions!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts