(1)(3)两个问题在KeyPress事件中编程判断
(2)可以在validdata事件中判断
(4)则需要改写DateEnvironment的Sql使之接收4个参数

解决方案 »

  1.   

    首先,你的20分是不是与你的问题的分量不相称:)所以没人回答。
    1)Private Sub Text1_KeyPress(KeyAscii As Integer)
        Static Ser As Integer
        Select Case Ser
            Case 0
                If (KeyAscii < 48) Or ((KeyAscii > 57) And (KeyAscii < 65)) Or ((KeyAscii > 90) And (KeyAscii < 97)) Or (KeyAscii > 122) Then
                    KeyAscii = 0
                Else
                    If KeyAscii > 96 Then
                        KeyAscii = KeyAscii - 32
                        
                    End If
                    Ser = Ser + 1
                End If
            Case 1, 2
                If KeyAscii < 48 Or KeyAscii > 57 Then
                    KeyAscii = 0
                Else
                    Ser = Ser + 1
                End If
            Case Else '以下三行回答你第三个问题,输完3个后自动跳到另一控件
                Ser = 0
                KeyAscii = 0
                Text2.SetFocus
        End Select
    End Sub2)Private Sub Text2_KeyPress(KeyAscii As Integer)
            
        If KeyAscii < 48 Or KeyAscii > 57 Then
            KeyAscii = 0
        Else
            If Len(Text2.Text) = 8 Then
                KeyAscii = 0
                Text2.Text = Left(Text2.Text, 4) + "/" + Mid(Text2.Text, 5, 2) + "/" + Right(Text2.Text, 2)
                Text1.SetFocus
            End If
        End If
        
    End Sub
    3)已经回答了,见1)
    4)没时间了,我要出去了,下次再写:)
      

  2.   

    Please capture Edit control`s message,you can do every thing you want!
      

  3.   

    对于第二个问题,如果输入的是2000-0203你将如何判断?我认为此时你可以选用MaskEditBox控件。试一下!