?? frmqueryrecord.frm
字號:
VERSION 5.00
Object = "{3A6644DE-3402-11D9-9DE7-C33FAA87690A}#1.0#0"; "WinXPCEngine.ocx"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{BEEECC20-4D5F-4F8B-BFDC-5D9B6FBDE09D}#1.0#0"; "vsFlex8.ocx"
Begin VB.Form FrmQueryRecord
BorderStyle = 3 'Fixed Dialog
Caption = "查詢員工檔案"
ClientHeight = 4920
ClientLeft = 45
ClientTop = 330
ClientWidth = 6255
Icon = "FrmQueryRecord.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 4920
ScaleWidth = 6255
ShowInTaskbar = 0 'False
Begin VSFlex8Ctl.VSFlexGrid VSDataRecord
Height = 2655
Left = 120
TabIndex = 11
Top = 2040
Width = 6015
_cx = 10610
_cy = 4683
Appearance = 1
BorderStyle = 1
Enabled = -1 'True
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
MousePointer = 0
BackColor = -2147483643
ForeColor = -2147483640
BackColorFixed = -2147483633
ForeColorFixed = -2147483630
BackColorSel = -2147483635
ForeColorSel = -2147483634
BackColorBkg = -2147483636
BackColorAlternate= -2147483643
GridColor = -2147483633
GridColorFixed = -2147483632
TreeColor = -2147483632
FloodColor = 192
SheetBorder = -2147483642
FocusRect = 1
HighLight = 1
AllowSelection = -1 'True
AllowBigSelection= -1 'True
AllowUserResizing= 0
SelectionMode = 0
GridLines = 1
GridLinesFixed = 2
GridLineWidth = 1
Rows = 50
Cols = 10
FixedRows = 1
FixedCols = 1
RowHeightMin = 0
RowHeightMax = 0
ColWidthMin = 0
ColWidthMax = 0
ExtendLastCol = 0 'False
FormatString = ""
ScrollTrack = 0 'False
ScrollBars = 3
ScrollTips = 0 'False
MergeCells = 0
MergeCompare = 0
AutoResize = -1 'True
AutoSizeMode = 0
AutoSearch = 0
AutoSearchDelay = 2
MultiTotals = -1 'True
SubtotalPosition= 1
OutlineBar = 0
OutlineCol = 0
Ellipsis = 0
ExplorerBar = 0
PicturesOver = 0 'False
FillStyle = 0
RightToLeft = 0 'False
PictureType = 0
TabBehavior = 0
OwnerDraw = 0
Editable = 0
ShowComboButton = 1
WordWrap = 0 'False
TextStyle = 0
TextStyleFixed = 0
OleDragMode = 0
OleDropMode = 0
DataMode = 0
VirtualData = -1 'True
DataMember = ""
ComboSearch = 3
AutoSizeMouse = -1 'True
FrozenRows = 0
FrozenCols = 0
AllowUserFreezing= 0
BackColorFrozen = 0
ForeColorFrozen = 0
WallPaperAlignment= 9
AccessibleName = ""
AccessibleDescription= ""
AccessibleValue = ""
AccessibleRole = 24
End
Begin VB.CommandButton CmdRetrun
Caption = "返回(&R)"
Height = 375
Left = 4920
TabIndex = 1
Top = 1560
Width = 1215
End
Begin VB.CommandButton CmdQuery
Caption = "查詢(&Q)"
Default = -1 'True
Height = 375
Left = 3600
TabIndex = 0
Top = 1560
Width = 1215
End
Begin VB.PictureBox PicFrame
Height = 1215
Left = 120
ScaleHeight = 1155
ScaleWidth = 5955
TabIndex = 6
Top = 240
Width = 6015
Begin VB.CheckBox ChKDate
Caption = "進(jìn)公司日期:"
Height = 255
Left = 120
TabIndex = 9
Top = 720
Width = 1455
End
Begin VB.TextBox TxtName
Height = 300
Left = 4560
MaxLength = 10
TabIndex = 3
Top = 210
Width = 1335
End
Begin VB.TextBox TxtCode
Height = 300
Left = 1560
MaxLength = 10
TabIndex = 2
Top = 210
Width = 1335
End
Begin VB.CheckBox ChkName
Caption = "按姓名查詢:"
Height = 255
Left = 3120
TabIndex = 8
Top = 240
Width = 1455
End
Begin VB.CheckBox ChkCode
Caption = "按編號查詢:"
Height = 255
Left = 120
TabIndex = 7
Top = 240
Width = 1455
End
Begin MSComCtl2.DTPicker DTPFromDate
Height = 300
Left = 1560
TabIndex = 4
Top = 697
Width = 1335
_ExtentX = 2355
_ExtentY = 529
_Version = 393216
Format = 72941569
CurrentDate = 38326
End
Begin MSComCtl2.DTPicker DTPToDate
Height = 300
Left = 4560
TabIndex = 5
Top = 697
Width = 1335
_ExtentX = 2355
_ExtentY = 529
_Version = 393216
Format = 72941569
CurrentDate = 38326
End
Begin VB.Label LblTO
AutoSize = -1 'True
Caption = "到"
Height = 180
Left = 3600
TabIndex = 10
Top = 750
Width = 180
End
End
Begin WinXPC_Engine.WindowsXPC WinXPQueryRecord
Left = 1200
Top = 240
_ExtentX = 6588
_ExtentY = 1085
ColorScheme = 2
Common_Dialog = 0 'False
End
Begin VB.Label LblLable
AutoSize = -1 'True
Caption = "條"
Height = 180
Index = 1
Left = 2160
TabIndex = 14
Top = 1680
Width = 180
End
Begin VB.Label LblCount
AutoSize = -1 'True
Height = 180
Left = 1800
TabIndex = 13
Top = 1680
Width = 90
End
Begin VB.Label LblLable
AutoSize = -1 'True
Caption = "當(dāng)前查詢記錄共:"
Height = 180
Index = 0
Left = 120
TabIndex = 12
Top = 1680
Width = 1440
End
End
Attribute VB_Name = "FrmQueryRecord"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CmdQuery_Click()
Dim StrSQL As String
StrSQL = "select * from 員工檔案 where " '//給定義好的字符變量賦予SQL語句
'//判斷復(fù)選框有一個(gè)選中時(shí),則
If ChkCode.Value = 1 Or ChkName.Value = 1 Or ChkDate.Value = 1 Then
'//判斷三個(gè)復(fù)選框同時(shí)選中時(shí),則
If ChkCode.Value = 1 And ChkName.Value = 1 And ChkDate.Value = 1 Then
StrSQL = StrSQL & "員工編號= '" & Trim(TxtCode.Text) & "'" & "and" & " 員工姓名 = '" & Trim(TxtName.Text) & "'" & "and" & " 進(jìn)入公司時(shí)間 between #" & DTPFromDate.Value & "# and #" & DTPToDate.Value & "#" & ""
'//判斷編號與姓名復(fù)選框選中時(shí),則
ElseIf ChkCode.Value = 1 And ChkName.Value = 1 Then
StrSQL = StrSQL & "員工編號= '" & Trim(TxtCode.Text) & "'" & "and" & " 員工姓名 = '" & Trim(TxtName.Text) & "'"
'//判斷編號與進(jìn)入公司時(shí)間復(fù)選框選中時(shí),則
ElseIf ChkCode.Value = 1 And ChkDate.Value = 1 Then
StrSQL = StrSQL & "員工編號= '" & Trim(TxtCode.Text) & "'" & "and" & " 進(jìn)入公司時(shí)間 between #" & DTPFromDate.Value & "# and #" & DTPToDate.Value & "#" & ""
'//判斷姓名與進(jìn)入公司時(shí)間復(fù)選框選中時(shí),則
ElseIf ChkName.Value = 1 And ChkDate.Value = 1 Then
StrSQL = StrSQL & " 員工姓名 = '" & Trim(TxtName.Text) & "'" & "and" & " 進(jìn)入公司時(shí)間 between #" & DTPFromDate.Value & "# and #" & DTPToDate.Value & "#" & ""
Else
If ChkCode.Value = 1 Then '//只有編號復(fù)選框選中時(shí),則
StrSQL = StrSQL & "員工編號= '" & Trim(TxtCode.Text) & "'"
End If
If ChkName.Value = 1 Then '//只有姓名復(fù)選框選中時(shí),則
StrSQL = StrSQL & " 員工姓名 = '" & Trim(TxtName.Text) & "'"
End If
If ChkDate.Value = 1 Then '//只有進(jìn)入公司時(shí)間復(fù)選框選中時(shí),則
StrSQL = StrSQL & "進(jìn)入公司時(shí)間 between #" & DTPFromDate.Value & "# and #" & DTPToDate.Value & "#" & ""
End If
End If
If RsQRecord.State = adStateClosed Then
RsQRecord.Open StrSQL, DBCON, adOpenKeyset, adLockOptimistic, adCmdText
End If
Set VSDataRecord.DataSource = RsQRecord.DataSource
LblCount.Caption = RsQRecord.RecordCount '//將記錄條數(shù)顯示在標(biāo)簽上
VSDataRecord.Refresh '//刷新網(wǎng)格
RsQRecord.Close '//關(guān)閉記錄集
TxtCode.Text = Empty '//請空文本框
TxtName.Text = Empty
Else
If RstQRecord.State = adStateClosed Then
RstQRecord.Open "員工檔案", DBCON, adOpenKeyset, adLockOptimistic, adCmdTable
End If
Set VSDataRecord.DataSource = RstQRecord.DataSource '//設(shè)置網(wǎng)格的數(shù)據(jù)源
LblCount.Caption = RstQRecord.RecordCount
End If
End Sub
Private Sub CmdRetrun_Click()
Unload Me
End Sub
Private Sub Form_Load()
WinXPQueryRecord.InitSubClassing
Me.Left = Frmmdimain.Width / 4
Me.Top = Frmmdimain.Height / 20
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -