📄 bcshd.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form16
BorderStyle = 3 'Fixed Dialog
Caption = "班次设定"
ClientHeight = 2490
ClientLeft = 45
ClientTop = 435
ClientWidth = 3345
LinkTopic = "Form16"
LockControls = -1 'True
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 2490
ScaleWidth = 3345
ShowInTaskbar = 0 'False
Begin VB.CommandButton Command2
Caption = "保 存"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Left = 1920
TabIndex = 15
Top = 1900
Width = 1000
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 2520
Top = 120
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.TextBox Text5
Enabled = 0 'False
Height = 300
Left = 1320
TabIndex = 14
Top = 1515
Width = 735
End
Begin VB.CommandButton Command1
Caption = "修 改"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Left = 480
TabIndex = 13
Top = 1900
Width = 1000
End
Begin VB.TextBox Text1
Alignment = 2 'Center
Enabled = 0 'False
Height = 300
Left = 1320
MaxLength = 2
TabIndex = 12
Top = 585
Width = 500
End
Begin VB.TextBox Text3
Alignment = 2 'Center
Enabled = 0 'False
Height = 300
Left = 2230
MaxLength = 2
TabIndex = 11
Top = 585
Width = 500
End
Begin VB.TextBox Text4
Alignment = 2 'Center
Enabled = 0 'False
Height = 300
Left = 2230
MaxLength = 2
TabIndex = 10
Top = 1050
Width = 500
End
Begin VB.TextBox Text2
Alignment = 2 'Center
Enabled = 0 'False
Height = 300
Left = 1320
MaxLength = 2
TabIndex = 9
Top = 1050
Width = 500
End
Begin VB.ComboBox Combo1
Height = 300
ItemData = "bcshd.frx":0000
Left = 1320
List = "bcshd.frx":0002
Style = 2 'Dropdown List
TabIndex = 1
Top = 120
Width = 750
End
Begin VB.Label Label8
Caption = "考勤时间:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 8
Top = 1538
Width = 1150
End
Begin VB.Label Label7
Caption = "分"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 2810
TabIndex = 7
Top = 1073
Width = 255
End
Begin VB.Label Label6
Caption = "时"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1920
TabIndex = 6
Top = 1073
Width = 255
End
Begin VB.Label Label5
Caption = "分"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 2810
TabIndex = 5
Top = 608
Width = 255
End
Begin VB.Label Label4
Caption = "时"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1920
TabIndex = 4
Top = 608
Width = 255
End
Begin VB.Label Label3
Caption = "下班时间:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 3
Top = 1073
Width = 1155
End
Begin VB.Label Label2
Caption = "上班时间:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 2
Top = 608
Width = 1155
End
Begin VB.Label Label1
Caption = "班 次 名:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 0
Top = 143
Width = 1155
End
End
Attribute VB_Name = "Form16"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim shbshj As String
Dim xbshj As String
Dim kqshj As String
Private Sub Combo1_Click()
rst.Open "select * from bancishedibiao where 班次名= '" & Combo1.Text & "'", con
shbshj = rst!上班时间
Text1.Text = Left$(shbshj, 2)
Text3.Text = Right$(shbshj, 2)
xbshj = rst!下班时间
Text2.Text = Left$(xbshj, 2)
Text4.Text = Right$(xbshj, 2)
kqshj = rst!考勤时间
If Left$(kqshj, 2) = Text1.Text Then
Text5.Text = "上班时"
ElseIf Left$(kqshj, 2) = Text2.Text Then
Text5.Text = "下班时"
Else
End If
rst.Close
End Sub
Private Sub Command1_Click()
Combo1.Enabled = False
Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
End Sub
Private Sub Command2_Click()
Text1.Text = Trim(Text1.Text)
Text2.Text = Trim(Text2.Text)
Text3.Text = Trim(Text3.Text)
Text4.Text = Trim(Text4.Text)
Text5.Text = Trim(Text5.Text)
If Text1.Text = "" Then MsgBox "请输入工作时间!", 48, 消息框: Exit Sub
If Text2.Text = "" Then MsgBox "请输入工作时间!", 48, 消息框: Exit Sub
If Text3.Text = "" Then MsgBox "请输入工作时间!", 48, 消息框: Exit Sub
If Text4.Text = "" Then MsgBox "请输入工作时间!", 48, 消息框: Exit Sub
If Text5.Text = "" Then MsgBox "请输入工作时间!", 48, 消息框: Exit Sub
shbshj = Text1.Text & "-" & Text3.Text
xbshj = Text2.Text & "-" & Text4.Text
If Text5.Text = "上班时" Then kqshj = shbshj Else kqshj = xbshj
my = "update bancishedibiao set 上班时间='" & shbshj & "',下班时间='" & xbshj & "',考勤时间='" & kqshj & "'where 班次名='" & Combo1.Text & "'"
con.BeginTrans
con.Execute my
r = MsgBox("是要修改吗?", vbYesNo + vbQuestion)
If r = vbYes Then
con.CommitTrans
Adodc1.Refresh
Else
con.RollbackTrans
End If
End Sub
Private Sub Form_Load()
rst.Open "select * from bancishedibiao ", con
Do While Not rst.EOF
Combo1.AddItem rst!班次名
rst.MoveNext
Loop
rst.Close
Adodc1.ConnectionString = s
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from bancishedibiao"
Adodc1.Refresh
Form16.Top = MDIForm1.Height / 3.5
Form16.Left = MDIForm1.Width / 2.8
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -