|
Private Sub 输入手机号码_KeyDown(KeyCode As Integer, Shift As Integer)
Dim strWhere As String
Dim strTemp As String
Dim intCount As Integer
If KeyCode = 191 Then
If Len(Me.输入手机号码.Text) >= 11 Then
strTemp = Mid(Me.输入手机号码.Text, Len(Me.输入手机号码.Text) - 10, 11)
strWhere = "手机='" & strTemp & "'"
intCount = DCount("*", "表1", strWhere)
If intCount = 0 Then
MsgBox "您刚输入的手机号码不存在"
End If
Else
MsgBox "您输入的电话号码位数不够"
KeyCode = 0
End If
End If
End Sub
Private Sub Command2_Click()
Dim strWhere As String, strSQL As String
Dim strArray() As String
Dim i As Integer
If IsNull(Me.输入手机号码) Then Exit Sub
strArray = Split(Me.输入手机号码, "/")
For i = 0 To UBound(strArray)
strWhere = strWhere & "'" & strArray(i) & "',"
Next
strSQL = "delete from 表1 where 手机 (" & strWhere & ")"
CurrentDb.Execute strSQL
End Sub
Private Sub 输入手机号码_Change()
Dim intLength As Integer
intLength = Len(Me.输入手机号码.Text)
If intLength > 600 Then
MsgBox "输入的号码数量已到极限"
End If
End Sub
Private Sub 输入手机号码_BeforeUpdate(Cancel As Integer)
If Right(Me.输入手机号码, 1) <> "/" Then
MsgBox "请输入“ / ”号结束输入"
Cancel = True
End If
End Sub |
|