VB+通讯录信息管理系统+文档PPT及开题报告(十)
'" + Text1(0).Text + "'"
End If
'判断QQ查询
If Check1(1).Value = 1 And Not IsNull(Text1(1).Text) Then
SQLadd = SQLadd + " and Oicq='" + Text1(1).Text + "'"
End If
'判断姓名查询
If Check1(2).Value = 1 And Not IsNull(Text1(2).Text) Then
SQLadd = SQLadd + " and Name='" + 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='" + Text1(5).Text + "'"
End If
'判断手机查询
If Check1(6).Value = 1 And Not IsNull(Text1(6).Text) Then
SQLadd = SQLadd + " and MoveCall='" + Text1(6).Text + "'"
End If
'判断宅电查询
If Check1(7).Value = 1 And Not IsNull(Text1(7).Text) Then
SQLadd = SQLadd + " and Home='" + Text1(7).Text + "'"
End If
'判断传呼查询
If Check1(8).Value = 1 And Not IsNull(Text1(8).Text) Then
SQLadd = SQLadd + " and Call='" + Text1(8).Text + "'"
End If
'判断传真查询
If Check1(9).Value = 1 And Not IsNull(Text1(9).Text) Then
SQLadd = SQLadd + " and Fax='" + Text1(9).Text + "'"
End If
'判断Email查询
If Check1(10).Value = 1 And Not IsNull(Text1(10).Text) Then
SQLadd = SQLadd + " and Email='" + Text1(10).Text + "'"
End If
'更新数据库显示信息
frmData.Data1.DatabaseName = frmData.mdbFile
frmData.Data1.RecordSource = SQLoriginal + SQLadd + SQLorder
frmData.Data1.Refresh
ListRefresh
Unload Me
Exit Sub
ErrHandle:
MsgBox Err.Description
Unload Me
Exit Sub
End Sub