?? 復件 frm_kq_bcsetup_1.frm
字號:
TabIndex = 12
Top = 2880
Width = 3615
_ExtentX = 6376
_ExtentY = 5318
_Version = 393216
AllowUpdate = -1 'True
AllowArrows = -1 'True
BackColor = 12639424
HeadLines = 1
RowHeight = 15
TabAction = 2
WrapCellPointer = -1 'True
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
SizeMode = 1
AllowRowSizing = 0 'False
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin GButton.GurhanButton GurhanButton1
Height = 615
Left = 6480
TabIndex = 13
Top = 480
Width = 1695
_ExtentX = 2990
_ExtentY = 1085
Caption = "開始設定周期 "
OriginalPicSizeW= 0
OriginalPicSizeH= 0
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
MouseIcon = "frm_KQ_BCSetup_1.frx":1DE9A
MousePointer = 99
XPStyle = -1 'True
End
Begin MSComctlLib.ProgressBar ProgressBar1
Height = 285
Left = 5760
TabIndex = 14
Top = 6120
Width = 3615
_ExtentX = 6376
_ExtentY = 503
_Version = 393216
Appearance = 1
Scrolling = 1
End
Begin VB.Label Label2
Caption = "開始日期"
Height = 255
Left = 6120
TabIndex = 11
Top = 2160
Width = 1005
End
Begin VB.Label Label1
Caption = "班次周期"
Height = 255
Left = 6120
TabIndex = 10
Top = 1440
Width = 1005
End
End
Attribute VB_Name = "frm_KQ_BCSetup_1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim mDB As New mDB
Dim strSQL As String
Dim adoprimaryRS As ADODB.Recordset
Attribute adoprimaryRS.VB_VarHelpID = -1
Dim strSQL2 As String
Dim adoPrimaryRS2 As ADODB.Recordset
Attribute adoPrimaryRS2.VB_VarHelpID = -1
Dim strSQL3 As String
Dim adoPrimaryRS3 As ADODB.Recordset
Attribute adoPrimaryRS3.VB_VarHelpID = -1
Dim strSQL4 As String
Dim adoprimaryRS4 As ADODB.Recordset
Attribute adoprimaryRS4.VB_VarHelpID = -1
Dim iRowStart As Integer
Dim iRowEnd As Integer
Private Sub datagrid1_HeadClick(ByVal ColIndex As Integer)
'Sort by clicked column
With adoPrimaryRS2
.Sort = .Fields(ColIndex).Name & " ASC"
End With
DataGrid1.Refresh
End Sub
Private Sub Form_Load()
Screen.MousePointer = vbHourglass
Set mDB = New mDB
mDB.InitDB_RY SQLConnDR
strSQL = "select distinct regualid,regualname from wktmregual" '''' where wktmid=2"
Set adoprimaryRS = mDB.adoprimaryRS(strSQL)
With DataCombo1(0)
Set .RowSource = adoprimaryRS
.BoundColumn = "regualid"
.ListField = "regualname"
.Refresh
End With
strSQL = "select dptid,dptname as 部門名稱 from depart order by dptname"
Set adoprimaryRS = mDB.adoprimaryRS(strSQL)
With MSHFlexGrid1
.ClearStructure
Set .DataSource = adoprimaryRS
.ColWidth(0) = 0
.ColWidth(1) = 2600
.Refresh
End With
strSQL4 = "select emplyid,regualid,wktmbg from empwktm"
Set adoprimaryRS4 = mDB.adoRSBatch(strSQL4)
MSHFlexGrid1_Click
Option2(0).Value = True
' With adoprimaryRS
' .MoveFirst
' SETIMER1(0).Text = TimeSerial(Hour(.Fields("bgnwktm1").Value), Minute(.Fields("bgnwktm1").Value), 0) '''' "00:00:01"
' SETIMER1(1).Text = TimeSerial(Hour(.Fields("bgntm1").Value), Minute(.Fields("bgntm1").Value), 0) '''' "00:00:01""23:59:59"
' SETIMER1(2).Text = TimeSerial(Hour(.Fields("endtm1").Value), Minute(.Fields("endtm1").Value), 0) '''' "00:00:01""23:59:59"
' SETIMER1(3).Text = TimeSerial(Hour(.Fields("endwktm1").Value), Minute(.Fields("endwktm1").Value), 0) '''' "00:00:01"
' .MoveNext
' SETIMER1(4).Text = TimeSerial(Hour(.Fields("bgnwktm1").Value), Minute(.Fields("bgnwktm1").Value), 0) '''' "00:00:01"
' SETIMER1(5).Text = TimeSerial(Hour(.Fields("bgntm1").Value), Minute(.Fields("bgntm1").Value), 0) '''' "00:00:01""23:59:59"
' SETIMER1(6).Text = TimeSerial(Hour(.Fields("endtm1").Value), Minute(.Fields("endtm1").Value), 0) '''' "00:00:01""23:59:59"
' SETIMER1(7).Text = TimeSerial(Hour(.Fields("endwktm1").Value), Minute(.Fields("endwktm1").Value), 0) '''' "00:00:01"
' End With
CenterForm Me
' ' Reload_DataGrid
'strSQL4 = "select wktmid,wktmdecs as 班次名稱,hours as 標準工時,(CASE WHEN wktmbg1 < 1 THEN '' ELSE substring(cast(wktmbg1 as char(22)),11,6) end) as 上班時間1,(case when drawtmbg1<1 then '' else substring(cast(drawtmbg1 as char(22)),11,6) end) as 上班刷卡1,latertime1 as 遲到時間1,(CASE WHEN wktmend1 < 1 THEN '' ELSE substring(cast(wktmend1 as char(22)),11,6) end) as 下班時間1," & _
' "(CASE WHEN drawtmend1 < 1 THEN '' ELSE substring(cast(drawtmend1 as char(22)),11,6) end) as 下班刷卡1,earlytime1 as 早退時間1,(CASE WHEN wktmbg2 < 1 THEN '' ELSE substring(cast(wktmbg2 as char(22)),11,6) end) as 上班時間2,(CASE WHEN drawtmbg2 < 1 THEN '' ELSE substring(cast(drawtmbg2 as char(22)),11,6) end) as 上班刷卡2,latertime2 as 遲到時間2,(CASE WHEN wktmend2 < 1 THEN '' ELSE substring(cast(wktmend2 as char(22)),11,6) end) as 下班時間2," & _
' "(CASE WHEN drawtmend2 < 1 THEN '' ELSE substring(cast(drawtmend2 as char(22)),11,6) end) as 下班刷卡2,earlytime2 as 早退時間2,(CASE WHEN wktmbg3 < 1 THEN '' ELSE substring(cast(wktmbg3 as char(22)),11,6) end) as 上班時間3,(CASE WHEN drawtmbg3 < 1 THEN '' ELSE substring(cast(drawtmbg3 as char(22)),11,6) end) as 上班刷卡3,latertime3 as 遲到時間3,(CASE WHEN wktmend3 < 1 THEN '' ELSE substring(cast(wktmend3 as char(22)),11,6) end) as 下班時間3," & _
' "(CASE WHEN drawtmend3 < 1 THEN '' ELSE substring(cast(drawtmend3 as char(22)),11,6) end) as 下班刷卡3,earlytime3 as 早退時間3,(CASE WHEN wktmbg4 < 1 THEN '' ELSE substring(cast(wktmbg4 as char(22)),11,6) end) as 上班時間4,(CASE WHEN drawtmbg4 < 1 THEN '' ELSE substring(cast(drawtmbg4 as char(22)),11,6) end) as 上班刷卡4,latertime4 as 遲到時間4,(CASE WHEN wktmend4 < 1 THEN '' ELSE substring(cast(wktmend4 as char(22)),11,6) end) as 下班時間4," & _
' "(CASE WHEN drawtmend4 < 1 THEN '' ELSE substring(cast(drawtmend4 as char(22)),11,6) end) as 下班刷卡4,earlytime4 as 早退時間4,(CASE WHEN bgnovertime < 1 THEN '' ELSE substring(cast(bgnovertime as char(22)),11,6) end) as 開始加班,(CASE WHEN endovertime < 1 THEN '' ELSE substring(cast(endovertime as char(22)),11,6) end) as 結束加班, " & _
' " from wktm"
''Debug.Print strSQL4
'
''strSQL4 = "select wktmid,wktmdecs,hours,bgnwktm1,bgntm1,endtm1,endwktm1,bgnwktm1_f,bgntm1_f,endtm1_f,endwktm1_f," & _
'' "bgnwktm2,bgntm2,endtm2,endwktm2,bgnwktm2_f,bgntm2_f,endtm2_f,endwktm2_f," & _
'' "bgnwktm3,bgntm3,endtm3,endwktm3,bgnwktm3_f,bgntm3_f,endtm3_f,endwktm3_f," & _
'' "bgnwktm4,bgntm4,endtm4,endwktm4,bgnwktm4_f,bgntm4_f,endtm4_f,endwktm4_f," & _
'' "hourskindid,processid,wktmnum,hourssys from wktm"
'strSQL4 = "select wktmid,wktmdecs,hours,bgnwktm1,bgntm1,endtm1,endwktm1," & _
' "bgnwktm2,bgntm2,endtm2,endwktm2," & _
' "bgnwktm3,bgntm3,endtm3,endwktm3," & _
' "bgnwktm4,bgntm4,endtm4,endwktm4" & _
' " from wktm"
'
'Set adoPrimaryRS4 = mDB.adoprimaryRS(strSQL4)
'Refresh_MSHFlexGrid
'With DataGrid1
' .ClearFields
' .DefColWidth = 900
' Set .DataSource = adoPrimaryRS4
'' .Columns(0).DataField = "ID"
'' .Columns(1).DataField = "iYear"
'' .Columns(2).DataField = "iMonth"
'' .Columns(3).DataField = "emplyID"
'' .Columns(4).DataField = "emplyName"
'' .Columns(5).DataField = "iFen"
'' .Columns(6).DataField = "iDay"
'' .Columns(3).Locked = True
'' .Columns(4).Locked = True
'' .Columns(0).width = 0
'' .Columns(1).width = 0
' .Columns(2).width = 1000
''' .Columns(3).width = 0
'' .Columns(3).Caption = "工號"
'' .Columns(4).Caption = "姓名"
'' .Columns(5).Caption = "評分"
'' .Columns(6).Caption = "工作天數"
' .Refresh
'End With
Screen.MousePointer = 0
End Sub
'Private Sub reload_datagrid()
' strSQL2 = "select dptid,dptname as 部門名稱,wkID from depart where wkID=1"
' Set adoPrimaryRS2 = mDB.adoprimaryRS(strSQL2)
' strSQL3 = "select dptid,dptname as 部門名稱,wkID from depart where wkID=2"
' Set adoPrimaryRS3 = mDB.adoprimaryRS(strSQL3)
' With DataGrid1
' .ClearFields
' Set .DataSource = adoPrimaryRS2
' .Columns(0).width = 0
' .Columns(2).width = 0
' .Refresh
' End With
' With DataGrid1
' .ClearFields
' Set .DataSource = adoPrimaryRS3
' .Columns(0).width = 0
' .Columns(2).width = 0
' .Refresh
' End With
'
'
'
'End Sub
Private Sub Form_Resize()
' MSHFlexGrid1.Move 245, 800, Me.width - 400, Me.height - 1300
End Sub
Private Sub Form_Unload(Cancel As Integer)
Screen.MousePointer = vbDefault
End Sub
Private Sub GurhanButton1_Click()
Dim i As Integer
Dim j As Integer
Dim sID As String
Dim d As Date
Dim iBC As Integer
d = DTPicker1(0).Value & " 16:47:00"
iBC = DataCombo1(0).BoundText
Dim nCount As Long
On Error Resume Next
If Option2(0).Value Then
MSHFlexGrid1.Col = 0
For i = 1 To MSHFlexGrid1.Rows - 1
MSHFlexGrid1.Row = i
sID = sID & MSHFlexGrid1.Text & ","
Next i
sID = Left(sID, Len(sID) - 1)
Debug.Print sID
strSQL = "select emplyid from emply where dptid in(" & sID & ")"
Set adoprimaryRS = mDB.adoprimaryRS(strSQL)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -