📄 工作表1.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form Form2
BackColor = &H00FFC0C0&
Caption = "工作报告"
ClientHeight = 7890
ClientLeft = 60
ClientTop = 345
ClientWidth = 9585
Icon = "工作表1.frx":0000
LinkTopic = "Form2"
ScaleHeight = 7890
ScaleWidth = 9585
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command8
Caption = "Command8"
Height = 375
Left = 8520
TabIndex = 20
Top = 6960
Width = 855
End
Begin VB.ComboBox Combo1
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
ItemData = "工作表1.frx":030A
Left = 3480
List = "工作表1.frx":0314
TabIndex = 16
Top = 480
Width = 1335
End
Begin VB.CommandButton Command1
BackColor = &H00FFC0C0&
Caption = "增 加"
Height = 375
Left = 120
Style = 1 'Graphical
TabIndex = 15
Top = 6960
Width = 975
End
Begin VB.CommandButton Command2
BackColor = &H00FF8080&
Caption = "保存"
Height = 375
Left = 3960
Style = 1 'Graphical
TabIndex = 14
Top = 6960
Width = 975
End
Begin VB.PictureBox Picture1
Height = 3615
Left = 0
Picture = "工作表1.frx":0328
ScaleHeight = 3555
ScaleWidth = 9315
TabIndex = 12
Top = 3120
Width = 9375
End
Begin VB.CommandButton Command4
BackColor = &H0000C0C0&
Caption = "退出"
Height = 375
Left = 5640
Style = 1 'Graphical
TabIndex = 11
Top = 6960
Width = 855
End
Begin VB.CommandButton Command3
BackColor = &H008080FF&
Caption = "查询"
Height = 375
Left = 7440
Style = 1 'Graphical
TabIndex = 10
Top = 6960
Width = 855
End
Begin VB.CommandButton Command5
BackColor = &H00FFC0C0&
Caption = "修改"
Height = 375
Left = 1080
Style = 1 'Graphical
TabIndex = 9
Top = 6960
Width = 855
End
Begin VB.CommandButton Command6
BackColor = &H00FFC0C0&
Caption = "删除"
Height = 375
Left = 1920
Style = 1 'Graphical
TabIndex = 8
Top = 6960
Width = 855
End
Begin VB.CommandButton Command7
BackColor = &H00FFC0C0&
Caption = "取消"
Height = 375
Left = 2760
Style = 1 'Graphical
TabIndex = 7
Top = 6960
Width = 855
End
Begin VB.Frame Frame1
BackColor = &H00FFC0C0&
Caption = "工作时间表"
Height = 1575
Left = 5760
TabIndex = 2
Top = 0
Width = 3495
Begin VB.ComboBox Combo2
BeginProperty DataFormat
Type = 1
Format = "dddddd aaaa"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 3
EndProperty
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
ItemData = "工作表1.frx":29232
Left = 1440
List = "工作表1.frx":29234
TabIndex = 3
Top = 960
Width = 1575
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 375
Left = 1440
TabIndex = 4
Top = 240
Width = 1575
_ExtentX = 2778
_ExtentY = 661
_Version = 393216
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Format = 81461249
CurrentDate = 38132
End
Begin VB.Label Label2
AutoSize = -1 'True
BackColor = &H00FFC0C0&
Caption = "工作日期:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Index = 0
Left = 120
TabIndex = 6
Top = 360
Width = 1200
End
Begin VB.Label Label2
AutoSize = -1 'True
BackColor = &H00FFC0C0&
Caption = "星期:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Index = 1
Left = 600
TabIndex = 5
Top = 960
Width = 720
End
End
Begin VB.ComboBox Combo3
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
ItemData = "工作表1.frx":29236
Left = 1080
List = "工作表1.frx":2923D
TabIndex = 1
Top = 480
Width = 1455
End
Begin VB.TextBox Text1
Height = 975
Left = 1320
TabIndex = 0
Top = 1920
Width = 7935
End
Begin MSComCtl2.MonthView MonthView1
Height = 2220
Left = 2160
TabIndex = 13
Top = 3600
Width = 4065
_ExtentX = 7170
_ExtentY = 3916
_Version = 393216
ForeColor = -2147483630
BackColor = 16761024
Appearance = 1
StartOfWeek = 81461249
CurrentDate = 38131
End
Begin VB.Label Label1
AutoSize = -1 'True
BackColor = &H00FFC0C0&
Caption = "姓名:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Index = 0
Left = 360
TabIndex = 19
Top = 480
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
BackColor = &H00FFC0C0&
Caption = "部门:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Index = 1
Left = 2760
TabIndex = 18
Top = 480
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
BackColor = &H00FFC0C0&
Caption = "工作情况:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Index = 2
Left = 120
TabIndex = 17
Top = 1920
Width = 1200
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim AddRecord As Boolean '定义是否为添加状态的标记
Dim ModifyRecord As Boolean '定义是否为修改
Private Sub Command1_Click() ' 增加
On Error GoTo CommandErr
Picture1.Visible = True
Picture1.Picture = LoadPicture(App.Path & "\美眉4.jpg")
ClearDisplay '清除所有文本框内容
Combo3.SetFocus '移光标至文本框text1(0)
DTPicker1.Value = Format(DTPicker1.Value, "YYYY-MM-DD")
Combo2.Text = Format(DTPicker1.Value, "aaaa")
AddRecord = True '目前是在添加状态
Exit Sub
CommandErr:
MsgBox Err.Description
End Sub
Private Sub Command2_Click() '保存
On Error GoTo CommandError
Picture1.Visible = True
Picture1.Picture = LoadPicture(App.Path & "\美眉4.jpg")
If Combo3.Text = "" Or Combo2.Text = "" Then '如果姓名、星期为空白
'显示错误信息
MsgBox "姓名与星期字段不可为空白", vbOKOnly + vbExclamation, ""
If Combo3.Text = "" Then '如果姓名为空白
Combo3.SetFocus '移动光标至姓名字段
ElseIf Combo2.Text = "" Then
Combo2.SetFocus
End If
ElseIf AddRecord = True Then '窗体在添加状态
On Error GoTo SaveAdd_ModifyError
BeginTrans '更改开始
rs1.AddNew '添加一组空白记录
WriteRecord '将窗体显示登录到记录上
rs1.Update '将记录写至数据库
CommitTrans '更改结束
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -