📄 frmbanci.frm
字号:
ForeColor = &H00FF0000&
Height = 255
Left = 360
TabIndex = 33
Top = 2520
Width = 1095
End
Begin VB.Label Label5
BackColor = &H00C0C0C0&
Caption = "刷卡次数:"
Enabled = 0 'False
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 255
Left = 360
TabIndex = 6
Top = 3180
Width = 1215
End
Begin VB.Label Label4
BackColor = &H00C0C0C0&
Caption = "班次号:"
Enabled = 0 'False
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 255
Left = 360
TabIndex = 5
Top = 1920
Width = 855
End
Begin VB.Label Label3
BackColor = &H00C0C0C0&
Caption = "职位:"
Enabled = 0 'False
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 255
Left = 360
TabIndex = 4
Top = 1260
Width = 735
End
Begin VB.Label Label2
BackColor = &H00C0C0C0&
Caption = "部门:"
Enabled = 0 'False
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 255
Left = 360
TabIndex = 3
Top = 600
Width = 735
End
End
Begin MSComCtl2.DTPicker DTPicker4
Height = 375
Left = 5280
TabIndex = 46
Top = 3360
Width = 1215
_ExtentX = 2143
_ExtentY = 661
_Version = 393216
Format = 24641537
CurrentDate = 37506
End
Begin MSComCtl2.DTPicker DTPicker5
Height = 375
Left = 5280
TabIndex = 47
Top = 3360
Width = 1215
_ExtentX = 2143
_ExtentY = 661
_Version = 393216
Format = 24641537
CurrentDate = 37506
End
Begin VB.Label Label1
BackColor = &H00000000&
BorderStyle = 1 'Fixed Single
Caption = "班次时间设置"
BeginProperty Font
Name = "黑体"
Size = 42
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 975
Left = 3600
TabIndex = 0
Top = 240
Width = 5295
End
End
Attribute VB_Name = "frmBanci"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public RstBan As ADODB.Recordset
Public CnnBan As ADODB.Connection
Public RstShuju As ADODB.Recordset
Dim Addinfo As Boolean
Dim ModiInfo As Boolean
Dim i As Integer
Private Sub Banhao_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Or KeyCode = 40 Then
BanMing.SetFocus
End If
If KeyCode = 38 Then
jiwei.SetFocus
End If
End Sub
Private Sub Banming_Change()
If BanMing.Text = "1" Then
BanMing.Text = "常班"
End If
If BanMing.Text = "2" Then
BanMing.Text = "早班"
End If
If BanMing.Text = "3" Then
BanMing.Text = "中班"
End If
If BanMing.Text = "4" Then
BanMing.Text = "夜班"
End If
End Sub
Private Sub BanMing_GotFocus()
StatusBar1.Panels(1).Text = "1、常班 2、早班 3、中班 4、夜班"
End Sub
Private Sub Banming_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Or KeyCode = 40 Then
Kashu.SetFocus
End If
If KeyCode = 38 Then
Banhao.SetFocus
End If
End Sub
Private Sub BanMing_LostFocus()
StatusBar1.Panels(1).Text = ""
End Sub
Private Sub Btnadd_Click()
Yi.Value = Format("00:00:00", "hh:mm:ss")
Yi1.Value = Format("00:00:00", "hh:mm:ss")
Yi2.Value = Format("00:00:00", "hh:mm:ss")
Er.Value = Format("00:00:00", "hh:mm:ss")
Er1.Value = Format("00:00:00", "hh:mm:ss")
Er2.Value = Format("00:00:00", "hh:mm:ss")
San.Value = Format("00:00:00", "hh:mm:ss")
San1.Value = Format("00:00:00", "hh:mm:ss")
San2.Value = Format("00:00:00", "hh:mm:ss")
Si.Value = Format("00:00:00", "hh:mm:ss")
Si1.Value = Format("00:00:00", "hh:mm:ss")
Si2.Value = Format("00:00:00", "hh:mm:ss")
Wu.Value = Format("00:00:00", "hh:mm:ss")
Wu1.Value = Format("00:00:00", "hh:mm:ss")
Wu2.Value = Format("00:00:00", "hh:mm:ss")
Liu.Value = Format("00:00:00", "hh:mm:ss")
Liu1.Value = Format("00:00:00", "hh:mm:ss")
Liu2.Value = Format("00:00:00", "hh:mm:ss")
bumen.Text = ""
jiwei.Text = ""
Banhao.Text = ""
BanMing.Text = ""
Kashu.Text = ""
' Yi.Value = ""
'SelBumen.Visible = False
SelJiwei.Visible = False
bumen.Enabled = True
jiwei.Enabled = True
Banhao.Enabled = True
BanMing.Enabled = True
Kashu.Enabled = True
Label5.Enabled = True
Label7.Enabled = True
Label4.Enabled = True
Label3.Enabled = True
Label2.Enabled = True
Addinfo = True
End Sub
Private Sub BtnExit_Click()
RstBan.Close
Set RstBan = Nothing
CnnBan.Close
Set CnnBan = Nothing
Unload Me
End Sub
Private Sub btnModi_Click()
ModiInfo = True
bumen.Visible = True
bumen.Enabled = True
SelJiwei.Visible = True
'SelBumen.Enabled = True
SelJiwei.Enabled = True
Banhao.Enabled = True
BanMing.Enabled = True
Kashu.Enabled = True
Label5.Enabled = True
Label7.Enabled = True
Label4.Enabled = True
Label3.Enabled = True
Label2.Enabled = True
End Sub
Private Sub BtnSame_Click()
Dim DaKashu As Integer
DaKashu = Kashu.Text
'For i = 1 To DaKashu
If Kashu.Text = 2 Then
If Xia1.Value = False And Xiang1.Value = False _
Or Xia2.Value = False And Xiang2.Value = False Then
' Or Xia3.Value = False And Xiang3.Value = False _
' Or Xia4.Value = False And Xiang4.Value = False _
' Or Xia5.Value = False And Xiang5.Value = False _
' Or Xia6.Value = False And Xiang6.Value = False Then
MsgBox "必须选择上下班!", vbOKOnly, "提醒!!"
Exit Sub
End If
'Next
End If
Set RstShuju = New ADODB.Recordset
RstShuju.Open "select banhao from ban where banhao='" + Banhao.Text + "' and banming='" + BanMing.Text + "'", CnnBan, adOpenStatic, adLockBatchOptimistic, adCmdText
If Not RstShuju.EOF And Addinfo = True Then
MsgBox "所输入的班号已存在,不能再写入!!", vbOKOnly, "提醒!!"
Exit Sub
End If
If ModiInfo = True Then
'CnnBan.Execute "DELETE FROM ban " _
& "WHERE " _
& "(bumen= ' " & Trim(bumen.Text) & " ') AND " _
& "(jiwei='" & Trim(SelJiwei.Text) & "') " _
& ""
CnnBan.Execute "DELETE FROM ban " _
& "WHERE " _
& "bumen='" + bumen.Text + "' and " _
& "jiwei='" + SelJiwei.Text + "' " _
& " "
End If
'If RstBan.EOF Then
' RstBan.MoveFirst
'End If
'If Not RstBan.EOF Then
RstBan.AddNew
If ModiInfo = True Then
RstBan.Fields(0) = bumen.Text
RstBan.Fields(1) = SelJiwei.Text
End If
If Addinfo = True Then
RstBan.Fields(0) = bumen.Text
RstBan.Fields(1) = jiwei.Text
End If
RstBan.Fields(2) = Banhao.Text
RstBan.Fields(3) = BanMing.Text
RstBan.Fields(4) = Kashu.Text
If Xiang1.Value = True Or Xia1.Value = True And Frame3.Visible = True Then
'Yi.Value = Format(Time, "hh:mm:ss")
RstBan.Fields(5) = Format(Yi.Value, "hh:mm:ss")
RstBan.Fields(18) = Format(Yi1.Value, "hh:mm:ss")
RstBan.Fields(19) = Format(Yi2.Value, "hh:mm:ss")
If Xiang1.Value = True Then
RstBan.Fields(6) = 1
End If
If Xia1.Value = True Then
RstBan.Fields(6) = 2
End If
Else
RstBan.Fields(6) = 0
End If
If Xiang2.Value = True Or Xia2.Value = True And Frame4.Visible = True Then
'Er.Value = Format(Time, "hh:mm:ss")
RstBan.Fields(7) = Format(Er.Value, "hh:mm:ss")
RstBan.Fields(20) = Format(Er1.Value, "hh:mm:ss")
RstBan.Fields(21) = Format(Er2.Value, "hh:mm:ss")
If Xiang2.Value = True Then
RstBan.Fields(8) = 1
End If
If Xia2.Value = True Then
RstBan.Fields(8) = 2
End If
Else
RstBan.Fields(8) = 0
End If
If Xiang3.Value = True Or Xia3.Value = True And Frame5.Visible = True Then
'San.Value = Format(Time, "hh:mm:ss")
RstBan.Fields(9) = Format(San.Value, "HH:MM:ss")
RstBan.Fields(22) = Format(San1.Value, "hh:mm:ss")
RstBan.Fields(23) = Format(San2.Value, "hh:mm:ss")
If Xiang3.Value = True Then
RstBan.Fields(10) = 1
End If
If Xia3.Value = True Then
RstBan.Fields(10) = 2
End If
Else
RstBan.Fields(10) = 0
End If
If Xiang4.Value = True Or Xia4.Value = True And Frame6.Visible = True Then
'Si.Value = Format(Time, "hh:mm:ss")
RstBan.Fields(11) = Format(Si.Value, "hh:mm:ss")
RstBan.Fields(24) = Format(Si1.Value, "hh:mm:ss")
RstBan.Fields(25) = Format(Si2.Value, "hh:mm:ss")
If Xiang4.Value = True Then
RstBan.Fields(12) = 1
End If
If Xia4.Value = True Then
RstBan.Fields(12) = 2
End If
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -