?? frmquerycomment.frm
字號:
VERSION 5.00
Object = "{3A6644DE-3402-11D9-9DE7-C33FAA87690A}#1.0#0"; "WinXPCEngine.ocx"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Object = "{BEEECC20-4D5F-4F8B-BFDC-5D9B6FBDE09D}#1.0#0"; "vsFlex8.ocx"
Begin VB.Form FrmQueryComment
BorderStyle = 3 'Fixed Dialog
Caption = "查詢工作評價"
ClientHeight = 5625
ClientLeft = 45
ClientTop = 330
ClientWidth = 7200
Icon = "FrmQueryComment.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 5625
ScaleWidth = 7200
ShowInTaskbar = 0 'False
Begin VSFlex8Ctl.VSFlexGrid VSDataComment
Height = 3735
Left = 120
TabIndex = 10
Top = 1560
Width = 6975
_cx = 12303
_cy = 6588
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 CmdClose
Caption = "關閉(&C)"
Height = 375
Left = 5880
TabIndex = 6
Top = 960
Width = 1215
End
Begin VB.CommandButton CmdQuery
Caption = "查詢(&Q)"
Default = -1 'True
Height = 375
Left = 4560
TabIndex = 5
Top = 960
Width = 1215
End
Begin VB.PictureBox PicFrame
Height = 735
Index = 1
Left = 120
ScaleHeight = 675
ScaleWidth = 6915
TabIndex = 0
Top = 120
Width = 6975
Begin VB.TextBox TxtName
Enabled = 0 'False
Height = 330
Left = 5040
TabIndex = 1
Top = 150
Width = 1695
End
Begin MSDataListLib.DataCombo CmbCode
Height = 330
Left = 1560
TabIndex = 3
Top = 150
Width = 1695
_ExtentX = 2990
_ExtentY = 582
_Version = 393216
Style = 2
Text = ""
End
Begin VB.CheckBox ChkCode
Caption = "按員工編號:"
Height = 255
Left = 120
TabIndex = 4
Top = 188
Width = 1575
End
Begin VB.CheckBox ChkName
Caption = "員工姓名:"
Height = 255
Left = 3720
TabIndex = 2
Top = 188
Width = 1215
End
End
Begin WinXPC_Engine.WindowsXPC WinXPQueryComment
Left = 1440
Top = 120
_ExtentX = 6588
_ExtentY = 1085
ColorScheme = 2
Common_Dialog = 0 'False
End
Begin VB.Label LblLable
AutoSize = -1 'True
Caption = "當前查詢記錄共:"
Height = 180
Index = 3
Left = 120
TabIndex = 9
Top = 1050
Width = 1440
End
Begin VB.Label LblCount
AutoSize = -1 'True
Height = 180
Left = 1800
TabIndex = 8
Top = 1050
Width = 90
End
Begin VB.Label LblLable
AutoSize = -1 'True
Caption = "條"
Height = 180
Index = 2
Left = 2160
TabIndex = 7
Top = 1050
Width = 180
End
End
Attribute VB_Name = "FrmQueryComment"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CmbCode_Change()
If RstQComment.State = adStateOpen Then
RstQComment.Close '//關閉記錄集
End If
RstQComment.Open "select *from 員工評價 where 員工編號='" & CmbCode.Text & "'", DBCON, adOpenKeyset, adLockOptimistic, adCmdText
TxtName.Text = RstQComment.Fields(1).Value '//給文本框賦值
End Sub
Private Sub CmdClose_Click()
Unload Me
End Sub
Private Sub CmdQuery_Click()
Dim StrSQL As String
StrSQL = "select * from 員工評價 where " '//給定義好的字符變量賦予SQL語句
'//判斷復選框有一個選中時,則
' If ChkCode.Value = 1 Or ChkName.Value = 1 Then
'//判斷二個復選框同時選中時,則
' If ChkCode.Value = 1 And ChkName.Value = 1 Then
' StrSQL = StrSQL & "員工編號= '" & Trim(CmbCode.Text) & "'" & "and" & " 員工姓名 = '" & Trim(TxtName.Text) & "'"
'//判斷編號與姓名復選框選中時,則
' Else
If ChkCode.Value = 1 Then '//只有編號復選框選中時,則
StrSQL = StrSQL & "員工編號= '" & Trim(CmbCode.Text) & "'"
' End If
' End If
If RstQueryComment.State = adStateClosed Then
RstQueryComment.Open StrSQL, DBCON, adOpenKeyset, adLockOptimistic, adCmdText
End If
Set VSDataComment.DataSource = RstQueryComment.DataSource
LblCount.Caption = RstQueryComment.RecordCount '//將記錄條數顯示在標簽上
VSDataComment.Refresh '//刷新網格
RstQueryComment.Close '//關閉記錄集
CmbCode.Text = Empty '//請空文本框
TxtName.Text = Empty
' TxtYear.Text = Empty
'CmbMonth.Text = Empty
Else
If RsQueryComment.State = adStateClosed Then
RsQueryComment.Open "員工評價", DBCON, adOpenKeyset, adLockOptimistic, adCmdTable
End If
Set VSDataComment.DataSource = RsQueryComment.DataSource '//設置網格的數據源
LblCount.Caption = RsQueryComment.RecordCount
VSDataComment.Refresh '//刷新網格
RsQueryComment.Close '//關閉記錄集
CmbCode.Text = Empty '//請空文本框
TxtName.Text = Empty
' TxtYear.Text = Empty
'CmbMonth.Text = Empty
End If
End Sub
Private Sub Form_Load()
WinXPQueryComment.InitSubClassing
Me.Left = Frmmdimain.Width / 5
Me.Top = 0
If RsQComment.State = adStateOpen Then
RsQComment.Close
End If
RsQComment.Open "員工評價", DBCON, adOpenKeyset, adLockPessimistic, adCmdTable
If RsQComment.RecordCount > 0 Then '//如果記錄集中有記錄
Set CmbCode.RowSource = RsQComment '//DATACOMBO中的數據等于記錄集
CmbCode.BoundColumn = "員工編號" '//綁定列
CmbCode.ListField = "員工編號"
Else '//否則。清空
CmbCode.Text = ""
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -