VB+通讯录信息管理系统+文档PPT及开题报告(九)
'判断姓名查询
If Check1(2).Value = 1 And Not IsNull(Text1(2).Text) Then
SQLadd = SQLadd + " and Name like'*" + Text1(2).Text + "*'"
End If
'性别查询
If Check1(3).Value = 1 Then
If Option1(0).Value = True Then
SQLadd = SQLadd + " and Sex='" + "男" + "'"
Else
SQLadd = SQLadd + " and Sex='" + "女" + "'"
End If
End If
'年龄查询
If Check1(4).Value = 1 Then
If Check2(0).Value = 1 And IsNumeric(Text2(0).Text) Then
If Check2(1).Value = 1 Then
SQLadd = SQLadd + " and Age<=" + Text2(1).Text
SQLadd = SQLadd + " and Age>=" + Text2(0).Text
Else
SQLadd = SQLadd + " and Age>=" + Text2(0).Text
End If
Else
If Check2(1).Value = 1 Then
SQLadd = SQLadd + " and Age<=" + Text2(1).Text
End If
End If
End If
'判断电话查询
If Check1(5).Value = 1 And Not IsNull(Text1(5).Text) Then
SQLadd = SQLadd + " and TelepNo like'*" + Text1(5).Text + "*'"
End If
'判断手机查询
If Check1(6).Value = 1 And Not IsNull(Text1(6).Text) Then
SQLadd = SQLadd + " and MoveCall like'*" + Text1(6).Text + "*'"
End If
'判断宅电查询
If Check1(7).Value = 1 And Not IsNull(Text1(7).Text) Then
SQLadd = SQLadd + " and Home like'*" + Text1(7).Text + "*'"
End If
'判断传呼查询
If Check1(8).Value = 1 And Not IsNull(Text1(8).Text) Then
SQLadd = SQLadd + " and Call like'*" + Text1(8).Text + "*'"
End If
'判断传真查询
If Check1(9).Value = 1 And Not IsNull(Text1(9).Text) Then
SQLadd = SQLadd + " and Fax like'*" + Text1(9).Text + "*'"
End If
'判断Email查询
If Check1(10).Value = 1 And Not IsNull(Text1(10).Text) Then
SQLadd = SQLadd + " and Email like'*" + Text1(10).Text + "*'"
End If
'更新数据库显示信息
frmData.Data1.DatabaseName = frmData.mdbFile 'App.Path + "\MyNote.mdb"
frmData.Data1.RecordSource = SQLoriginal + SQLadd + SQLorder
frmData.Data1.Refresh
ListRefresh
Unload Me
Exit Sub
ErrHandle:
MsgBox Err.Description
Unload Me
Exit Sub
End Sub
Private Sub Command2_Click() '精确查询
On Error GoTo ErrHandle
'判断昵称查询
If Check1(0).Value = 1 And Not IsNull(Text1(0).Text) Then
SQLadd = SQLadd + " and Love=