|
Private Sub 命令开始查询_Click()
On Error GoTo Err_命令开始查询_Click
fire = True
str2 = "SELECT 综合查询_文书.文件题目,综合查询_文书.关键词,综合查询_文书.题名,综合查询_文书.文号,综合查询_文书.顺序号,综合查询_文书.来文时间,综合查询_文书.来文时间1,综合查询_文书.密级,综合查询_文书.责任者 , 综合查询_文书.页数, 综合查询_文书.卷id, 综合查询_文书.id, 综合查询_文书.存档位置, 综合查询_文书.销毁 FROM 综合查询_文书"
If Not IsNull(文件题目) Then
If fire Then
str2 = str2 & " where 文件题目 like '*" & 文件题目 & "*'"
fire = False
Else
str2 = str2 & " and 文件题目 like '*" & 文件题目 & "*'"
End If
End If
If Not IsNull(关键词) Then
If fire Then
str2 = str2 & " where 关键词 like '*" & 关键词 & "*'"
fire = False
Else
str2 = str2 & " and 关键词 like '*" & 关键词 & "*'"
End If
End If
If Not IsNull(题名) Then
If fire Then
str2 = str2 & " where 题名 like '*" & 题名 & "*'"
fire = False
Else
str2 = str2 & " and 题名 like '*" & 题名 & "*'"
End If
End If
If Not IsNull(文号) Then
If fire Then
str2 = str2 & " where 文号 like '*" & 文号 & "*'"
fire = False
Else
str2 = str2 & " and 文号 like '*" & 文号 & "*'"
End If
End If
If Not IsNull(顺序号) Then
If fire Then
str2 = str2 & " where 顺序号 like '*" & 顺序号 & "*'"
fire = False
Else
str2 = str2 & " and 顺序号 like '*" & 顺序号 & "*'"
End If
End If
If Not IsNull(来文时间) Then
If fire Then
str2 = str2 & " where 来文时间 like '*" & 来文时间 & "*'"
fire = False
Else
str2 = str2 & " and 来文时间 like '*" & 来文时间 & "*'"
End If
End If
If Not IsNull(来文时间1) Then
If fire Then
str2 = str2 & " where 来文时间1 like '*" & 来文时间1 & "*'"
fire = False
Else
str2 = str2 & " and 来文时间1 like '*" & 来文时间1 & "*'"
End If
End If
If Not IsNull(密级) Then
If fire Then
str2 = str2 & " where 密级 = '*" & 密级 & "*'"
fire = False
Else
str2 = str2 & " and 密级 = '*" & 密级 & "*'"
End If
End If
If Not IsNull(责任者) Then
If fire Then
str2 = str2 & " where 责任者 = '*" & 责任者 & "*'"
fire = False
Else
str2 = str2 & " and 责任者 = '*" & 责任者 & "*'"
End If
End If
If Not IsNull(页数) Then
If fire Then
str2 = str2 & " where 页数 like '*" & 页数 & "*'"
fire = False
Else
str2 = str2 & " and 页数 like '*" & 页数 & "*'"
End If
End If
If Not IsNull(卷id) Then
If fire Then
str2 = str2 & " where 卷id like '*" & 卷id & "*'"
fire = False
Else
str2 = str2 & " and 卷id like '*" & 卷id & "*'"
End If
End If
If Not IsNull(id) Then
If fire Then
str2 = str2 & " where id like '*" & id & "*'"
fire = False
Else
str2 = str2 & " and id like '*" & id & "*'"
End If
End If
If Not IsNull(存档位置) Then
If fire Then
str2 = str2 & " where 存档位置 = '*" & 存档位置 & "*'"
fire = False
Else
str2 = str2 & " and 存档位置 = '*" & 存档位置 & "*'"
End If
End If
If Not IsNull(销毁) Then
If fire Then
str2 = str2 & " where 销毁 like '*" & 销毁 & "*'"
fire = False
Else
str2 = str2 & " and 销毁 like '*" & 销毁 & "*'"
End If
End If
If IsNull(文件题目) A |
|