📄 frmvischeck.frm
字号:
VERSION 5.00
Object = "{CFA7AFF4-3242-4269-9172-7389D695AE01}#1.0#0"; "stonexp.ocx"
Begin VB.Form frmVisCheck
BorderStyle = 1 'Fixed Single
Caption = "访客查询"
ClientHeight = 1950
ClientLeft = 45
ClientTop = 435
ClientWidth = 6735
Icon = "frmVisCheck.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 1950
ScaleWidth = 6735
StartUpPosition = 3 '窗口缺省
Begin StoneXP.XPFrame XPFrame1
Height = 1935
Left = 0
TabIndex = 0
Top = 0
Width = 6735
_ExtentX = 11880
_ExtentY = 3413
Caption = ""
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Begin VB.TextBox txtDate
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4680
TabIndex = 10
Top = 840
Width = 1815
End
Begin VB.TextBox txtDorm
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1320
TabIndex = 3
Top = 840
Width = 1815
End
Begin VB.TextBox txtBName
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4680
TabIndex = 2
Top = 360
Width = 1815
End
Begin VB.TextBox txtVName
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1320
TabIndex = 1
Top = 360
Width = 1815
End
Begin StoneXP.XPButton cmbCheck
Default = -1 'True
Height = 375
Left = 4680
TabIndex = 4
Top = 1440
Width = 855
_ExtentX = 1508
_ExtentY = 661
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "查询"
MouseIcon = "frmVisCheck.frx":06EA
MousePointer = 99
End
Begin StoneXP.XPButton cmbCancle
Height = 375
Left = 5640
TabIndex = 5
Top = 1440
Width = 855
_ExtentX = 1508
_ExtentY = 661
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "取消"
MouseIcon = "frmVisCheck.frx":0A04
MousePointer = 99
End
Begin VB.Label Label3
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "宿舍编号"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 255
Left = 240
TabIndex = 9
Top = 960
Width = 1095
End
Begin VB.Label Label2
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "被访人姓名"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 255
Left = 3360
TabIndex = 8
Top = 480
Width = 1335
End
Begin VB.Label Label1
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "访客姓名"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 255
Left = 240
TabIndex = 7
Top = 480
Width = 1095
End
Begin VB.Label Label4
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "来访日期"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 255
Left = 3360
TabIndex = 6
Top = 960
Width = 1215
End
End
End
Attribute VB_Name = "frmVisCheck"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmbCancle_Click()
'按取消按钮时显示所有访客资料,按来访日期降序排列
QuaryString = "select * from visit order by Vis_Date DESC"
Unload Me
End Sub
Private Sub cmbCheck_Click()
Dim isFirst As Boolean '是否首条件标志
'判断是否输入查询条件
If Trim(txtVName.Text) = "" And Trim(txtBName.Text) = "" And Trim(txtDorm.Text) = "" And Trim(txtDate.Text) = "" Then
MsgBox "请输入查询条件!", vbOKOnly + vbExclamation, "提示"
Exit Sub
End If
'根据输入条件生成数据库查询语句(QuaryString)
isFirst = True
QuaryString = "select * from visit where"
If Trim(txtVName.Text) <> "" Then '访客姓名不为空
QuaryString = QuaryString & " Vis_Name='" & Trim(txtVName.Text) & "'"
isFirst = False
End If
If Trim(txtBName.Text) <> "" Then '被访人姓名不为空
If isFirst = False Then
QuaryString = QuaryString & " and Vis_Host='" & Trim(txtBName.Text) & "'"
Else
QuaryString = QuaryString & " Vis_Host='" & Trim(txtBName.Text) & "'"
isFirst = False
End If
End If
If Trim(txtDorm.Text) <> "" Then '宿舍不为空
If isFirst = False Then
QuaryString = QuaryString & " and Dor_Id='" & Trim(txtDorm.Text) & "'"
Else
QuaryString = QuaryString & " Dor_Id='" & Trim(txtDorm.Text) & "'"
isFirst = False
End If
End If
If Trim(txtDate.Text) <> "" Then '来访日期不为空
If isFirst = False Then
QuaryString = QuaryString & " and Vis_Date='" & Format(Trim(txtDate.Text), "YYYY-MM-DD") & "'"
Else
QuaryString = QuaryString & " Vis_Date='" & Format(Trim(txtDate.Text), "YYYY-MM-DD") & "'"
isFirst = False
End If
End If
QuaryString = QuaryString & " ORDER BY Vis_Date DESC" '按来访日期降序排列
Unload Me
End Sub
Private Sub Form_Load()
XPFrame1.BackColor = RGB(198, 229, 211) '设置背景颜色
Me.Left = frmMain.Left + (frmMain.Width - Me.Width) / 2 '设置窗体显示位置
Me.Top = frmMain.Top + (frmMain.Height - Me.Height) / 2 '设置窗体显示位置
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -