📄 main_kfgl_kscx.frm
字号:
EndProperty
BeginProperty ListImage42 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "main_kfgl_kscx.frx":4F824
Key = ""
EndProperty
BeginProperty ListImage43 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "main_kfgl_kscx.frx":51376
Key = ""
EndProperty
BeginProperty ListImage44 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "main_kfgl_kscx.frx":52EC8
Key = ""
EndProperty
BeginProperty ListImage45 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "main_kfgl_kscx.frx":54A1A
Key = ""
EndProperty
BeginProperty ListImage46 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "main_kfgl_kscx.frx":5656C
Key = ""
EndProperty
BeginProperty ListImage47 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "main_kfgl_kscx.frx":580BE
Key = ""
EndProperty
BeginProperty ListImage48 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "main_kfgl_kscx.frx":59C10
Key = ""
EndProperty
BeginProperty ListImage49 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "main_kfgl_kscx.frx":5B762
Key = ""
EndProperty
BeginProperty ListImage50 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "main_kfgl_kscx.frx":5D2B4
Key = ""
EndProperty
BeginProperty ListImage51 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "main_kfgl_kscx.frx":5EE06
Key = ""
EndProperty
BeginProperty ListImage52 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "main_kfgl_kscx.frx":60958
Key = ""
EndProperty
EndProperty
End
End
Attribute VB_Name = "main_kfgl_kscx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'
Dim SFZ As String
Dim DJ_query As Boolean
Dim DATA_edit As Boolean
Dim Field_Type As Integer
Dim Field_Value As String
Dim FindFieldC As String
Dim ZH_find As String
Dim ZH_find1 As String
Dim ZH_ysh As String
Dim SF_BG As Boolean
Dim BD_BG As Boolean
Dim Or_Field As String
Dim US_Field As String
Dim Data_Rec As Long
Dim TY_XG As Boolean
Dim FB_table1 As String
Private Sub Command1_Click(Index As Integer)
Dim i As Integer
'On Error GoTo E3008
PE3008:
Select Case Index
Case Is = 0
Unload Me
Case Is = 1
Adodc1.ConnectionString = My_PROVIDER
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from " & FB_table1
Adodc1.Refresh
Case Is = 2
If FindFieldC = "" Then
MsgBox "请注意:您未选择字段!", 48, "提示"
Else
Me.Picture1.Visible = True
Me.Label13.Caption = "{" & FindFieldC & "}"
Me.Field_Z.Text = ""
Me.Field_Z.SetFocus
If Not DJ_query Then
ZH_find1 = ""
End If
End If
Case Is = 3
If Not DJ_query Then
DJ_query = True
Me.Command1(3).Value = tbrPressed
Else
DJ_query = False
Me.Command1(3).Value = tbrUnpressed
End If
Case Is = 4
Set rtpRS = Adodc1.Recordset
rtpTitle = Me.Caption
Call rtpExcel
End Select
End Sub
Private Sub Command4_Click()
On Error GoTo ERR_pro201
Picture1.Visible = False
If Me.Option1.Value Then
ZH_ysh = " like "
End If
If Me.Option2.Value Then
ZH_ysh = " >= "
End If
If Me.Option3.Value Then
ZH_ysh = " <= "
End If
If Me.Option4.Value Then
ZH_ysh = " = "
End If
If Me.Option5.Value Then
ZH_ysh = " <> "
End If
If Me.Option6.Value Then
ZH_ysh = " like "
End If
Field_Value = Field_Z.Text
'MsgBox Field_Type
If Field_Value <> "" Then
If Field_Value = "null" Or field_valu = "NULL" Then
If ZH_find1 = "" Then
'空值,单级
'ZH_find1 = FindFieldC & " like " & "'" & Field_Value & "'"
If Me.Option6.Value Then
If Field_Type = 200 Then ZH_find1 = " not " & FindFieldC & " is null"
If Field_Type = 202 Then ZH_find1 = " not " & FindFieldC & " is null"
If Field_Type = 7 Then ZH_find1 = " not " & FindFieldC & " is null"
If Field_Type = 135 Then ZH_find1 = " not " & FindFieldC & " is null"
If Field_Type = 2 Then ZH_find1 = " not " & FindFieldC & " is null"
If Field_Type = 6 Then ZH_find1 = " not " & FindFieldC & " is null"
Else
If Field_Type = 200 Then ZH_find1 = FindFieldC & " is null"
If Field_Type = 202 Then ZH_find1 = FindFieldC & " is null"
If Field_Type = 7 Then ZH_find1 = FindFieldC & " is null"
If Field_Type = 135 Then ZH_find1 = FindFieldC & " is null"
If Field_Type = 2 Then ZH_find1 = FindFieldC & " is null"
If Field_Type = 6 Then ZH_find1 = FindFieldC & " is null"
End If
Else
'空值,多级
'ZH_find1 = ZH_find1 & " and " & FindFieldC & " like " & "'" & Field_Value & "'"
If Me.Option6.Value Then
If Field_Type = 200 Then ZH_find1 = ZH_find1 & " and not " & FindFieldC & " is null"
If Field_Type = 202 Then ZH_find1 = ZH_find1 & " And not " & FindFieldC & " is null"
If Field_Type = 7 Then ZH_find1 = ZH_find1 & " and not " & FindFieldC & " is null"
If Field_Type = 135 Then ZH_find1 = ZH_find1 & " and not " & FindFieldC & " is null"
If Field_Type = 2 Then ZH_find1 = ZH_find1 & " and not " & FindFieldC & " is null"
If Field_Type = 6 Then ZH_find1 = ZH_find1 & " and not " & FindFieldC & " is null"
Else
If Field_Type = 200 Then ZH_find1 = ZH_find1 & " and " & FindFieldC & " is null"
If Field_Type = 202 Then ZH_find1 = ZH_find1 & " And " & FindFieldC & " is null"
If Field_Type = 7 Then ZH_find1 = ZH_find1 & " and " & FindFieldC & " is null"
If Field_Type = 135 Then ZH_find1 = ZH_find1 & " and " & FindFieldC & " is null"
If Field_Type = 2 Then ZH_find1 = ZH_find1 & " and " & FindFieldC & " is null"
If Field_Type = 6 Then ZH_find1 = ZH_find1 & " and " & FindFieldC & " is null"
End If
End If
Else
If ZH_find1 = "" Then
'非空值,单级
'ZH_find1 = FindFieldC & " like " & "'" & Field_Value & "'"
If Me.Option6.Value Then
If Field_Type = 200 Then ZH_find1 = " (not " & FindFieldC & ZH_ysh & "'" & Field_Value & "' or " & FindFieldC & " is null)"
If Field_Type = 202 Then ZH_find1 = " (not " & FindFieldC & ZH_ysh & "'" & Field_Value & "' or " & FindFieldC & " is null)"
If Field_Type = 7 Then ZH_find1 = " (not " & FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "# or " & FindFieldC & " is null)"
If Field_Type = 135 Then ZH_find1 = " (not " & FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "# or " & FindFieldC & " is null)"
If Field_Type = 2 Then ZH_find1 = " (not " & FindFieldC & ZH_ysh & CInt(Field_Value) & " or " & FindFieldC & " is null)"
If Field_Type = 6 Then ZH_find1 = " (not " & FindFieldC & ZH_ysh & CInt(Field_Value) & " or " & FindFieldC & " is null)"
Else
If Field_Type = 200 Then ZH_find1 = FindFieldC & ZH_ysh & "'" & Field_Value & "'"
If Field_Type = 202 Then ZH_find1 = FindFieldC & ZH_ysh & "'" & Field_Value & "'"
If Field_Type = 7 Then ZH_find1 = FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "#"
If Field_Type = 135 Then ZH_find1 = FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "#"
If Field_Type = 2 Then ZH_find1 = FindFieldC & ZH_ysh & CInt(Field_Value)
If Field_Type = 6 Then ZH_find1 = FindFieldC & ZH_ysh & CInt(Field_Value)
End If
Else
'非空值,多级
'ZH_find1 = ZH_find1 & " and " & FindFieldC & " like " & "'" & Field_Value & "'"
If Me.Option6.Value Then
If Field_Type = 200 Then ZH_find1 = ZH_find1 & " and (not " & FindFieldC & ZH_ysh & "'" & Field_Value & "' or " & FindFieldC & " is null)"
If Field_Type = 202 Then ZH_find1 = ZH_find1 & " And (not " & FindFieldC & ZH_ysh & " '" & Field_Value & "' or " & FindFieldC & " is null)"
If Field_Type = 7 Then ZH_find1 = ZH_find1 & " and (not " & FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "# or " & FindFieldC & " is null)"
If Field_Type = 135 Then ZH_find1 = ZH_find1 & " and (not " & FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "# or " & FindFieldC & " is null)"
If Field_Type = 2 Then ZH_find1 = ZH_find1 & " and (not " & FindFieldC & ZH_ysh & CInt(Field_Value) & " or " & FindFieldC & " is null)"
If Field_Type = 6 Then ZH_find1 = ZH_find1 & " and (not " & FindFieldC & ZH_ysh & CInt(Field_Value) & " or " & FindFieldC & " is null)"
Else
If Field_Type = 200 Then ZH_find1 = ZH_find1 & " and " & FindFieldC & ZH_ysh & "'" & Field_Value & "'"
If Field_Type = 202 Then ZH_find1 = ZH_find1 & " And " & FindFieldC & ZH_ysh & " '" & Field_Value & "'"
If Field_Type = 7 Then ZH_find1 = ZH_find1 & " and " & FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "#"
If Field_Type = 135 Then ZH_find1 = ZH_find1 & " and " & FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "#"
If Field_Type = 2 Then ZH_find1 = ZH_find1 & " and " & FindFieldC & ZH_ysh & CInt(Field_Value)
If Field_Type = 6 Then ZH_find1 = ZH_find1 & " and " & FindFieldC & ZH_ysh & CInt(Field_Value)
End If
End If
End If
'多级与单级分类
If DJ_query Then
ZH_find = " where " & ZH_find1
Else
'ZH_find = " where " & FindFieldC & " like " & "'" & Field_Value & "'"
If Field_Value = "null" Or field_valu = "NULL" Then
'空值
If Me.Option6.Value Then
If Field_Type = 200 Then ZH_find = " where not " & FindFieldC & " is null"
If Field_Type = 202 Then ZH_find = " where not " & FindFieldC & " is null"
If Field_Type = 7 Then ZH_find = " where not " & FindFieldC & " is null"
If Field_Type = 135 Then ZH_find = " where not " & FindFieldC & " is null"
If Field_Type = 2 Then ZH_find = " where not " & FindFieldC & " is null"
If Field_Type = 6 Then ZH_find = " where not " & FindFieldC & " is null"
Else
If Field_Type = 200 Then ZH_find = " where " & FindFieldC & " is null"
If Field_Type = 202 Then ZH_find = " where " & FindFieldC & " is null"
If Field_Type = 7 Then ZH_find = " where " & FindFieldC & " is null"
If Field_Type = 135 Then ZH_find = " where " & FindFieldC & " is null"
If Field_Type = 2 Then ZH_find = " where " & FindFieldC & " is null"
If Field_Type = 6 Then ZH_find = " where " & FindFieldC & " is null"
End If
Else
If Me.Option6.Value Then
If Field_Type = 200 Then ZH_find = " where not " & FindFieldC & ZH_ysh & "'" & Field_Value & "' or " & FindFieldC & " is null"
If Field_Type = 202 Then ZH_find = " where not " & FindFieldC & ZH_ysh & "'" & Field_Value & "' or " & FindFieldC & " is null"
If Field_Type = 7 Then ZH_find = " where not " & FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "# or " & FindFieldC & " is null"
If Field_Type = 135 Then ZH_find = " where not " & FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "# or " & FindFieldC & " is null"
If Field_Type = 2 Then ZH_find = " where not " & FindFieldC & ZH_ysh & CInt(Field_Value) & " or " & FindFieldC & " is null"
If Field_Type = 6 Then ZH_find = " where not " & FindFieldC & ZH_ysh & CInt(Field_Value) & " or " & FindFieldC & " is null"
Else
If Field_Type = 200 Then ZH_find = " where " & FindFieldC & ZH_ysh & "'" & Field_Value & "'"
If Field_Type = 202 Then ZH_find = " where " & FindFieldC & ZH_ysh & "'" & Field_Value & "'"
If Field_Type = 7 Then ZH_find = " where " & FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "#"
If Field_Type = 135 Then ZH_find = " where " & FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "#"
If Field_Type = 2 Then ZH_find = " where " & FindFieldC & ZH_ysh & CInt(Field_Value)
If Field_Type = 6 Then ZH_find = " where " & FindFieldC & ZH_ysh & CInt(Field_Value)
End If
End If
End If
MsgBox ZH_find
FB_table2 = " 姓名,证件号码,证件名称,级别 from 客人资料 " & ZH_find
US_Field = " 姓名,证件号码,证件名称,级别 from 客人资料 " & ZH_find
MsgBox FB_table2
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select " & FB_table2
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
DataGrid1.ReBind
DataGrid1.Refresh
'DataGrid1.Columns(0).Width = 1
DataGrid1.Columns(2).Width = 800
DataGrid1.Columns(3).Width = 500
If Adodc1.Recordset.RecordCount = 0 Then
MsgBox "请注意:你所查找的用户不存在,请核对!", vbOKOnly, "错误信息"
End If
End If
Exit Sub
ERR_pro201:
MsgBox "请注意:查询错误,重新操作!", 48, "提示"
End Sub
Private Sub Command5_Click()
Me.Picture1.Visible = False
End Sub
Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
SFZ = Adodc1.Recordset.Fields("证件号码")
FindFieldC = Adodc1.Recordset.Fields(DataGrid1.Col).Name
Field_Type = CInt(Adodc1.Recordset.Fields(DataGrid1.Col).Type)
Adodc2.ConnectionString = My_PROVIDER
Adodc2.CommandType = adCmdText
Adodc2.RecordSource = "select * from 住宿情况 where 证件号码 like '" & SFZ & "'"
Adodc2.Refresh
Set DataGrid2.DataSource = Adodc2
DataGrid2.ReBind
DataGrid2.Refresh
End Sub
Private Sub Form_Load()
'初始化窗口位置
Me.Left = MDIForm1.Picture1.Width
Me.Top = (Screen.Height - Me.Height) / 2
FindFieldC = "姓名"
ZH_find = ""
ZH_find1 = ""
DJ_query = False
ZH_ysh = " like "
SF_BG = False
BD_BG = False
Or_Field = " 姓名"
US_Field = ""
Adodc1.ConnectionString = My_PROVIDER
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select 姓名,证件号码,证件名称,级别 from 客人资料"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
DataGrid1.ReBind
DataGrid1.Refresh
'DataGrid1.Columns(0).Width = 1
DataGrid1.Columns(2).Width = 800
DataGrid1.Columns(3).Width = 500
FB_table2 = " 姓名,证件号码,证件名称,级别 from 客人资料"
US_Field = " 姓名,证件号码,证件名称,级别 from 客人资料"
FB_table1 = FB_table2
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -