📄 frm月库生成.frm
字号:
VERSION 5.00
Begin VB.Form frm月库生成
Caption = "月库生成"
ClientHeight = 1860
ClientLeft = 60
ClientTop = 345
ClientWidth = 4005
LinkTopic = "Form1"
ScaleHeight = 1860
ScaleWidth = 4005
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Cancel = -1 'True
Caption = "放弃(&Q)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 2280
TabIndex = 6
Top = 1230
Width = 1185
End
Begin VB.CommandButton Command1
Caption = "确定(&E)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 630
TabIndex = 5
Top = 1230
Width = 1185
End
Begin VB.TextBox montext
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 3060
MaxLength = 2
TabIndex = 4
Top = 630
Width = 435
End
Begin VB.TextBox yeartext
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 1560
MaxLength = 4
TabIndex = 2
Top = 630
Width = 585
End
Begin VB.Label Label3
Caption = "月:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 2490
TabIndex = 3
Top = 630
Width = 465
End
Begin VB.Label Label2
Caption = "年:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 1020
TabIndex = 1
Top = 630
Width = 465
End
Begin VB.Label Label1
Caption = "需要生成工资的年月:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 345
Left = 90
TabIndex = 0
Top = 90
Width = 2505
End
End
Attribute VB_Name = "frm月库生成"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Len(Trim(yeartext.Text)) <> 4 Then
yn = MsgBox("年份不是四位数错误,请重输!", 48)
Else
If Val(yeartext.Text) < 2001 Or Val(yeartext.Text) > Year(Date) Then
yn = MsgBox("年份输入错误,输入值应大于等于2001小于系统年份,请重输!", 48)
Else
ye = Trim(yeartext.Text)
If Len(Trim(montext.Text)) <> 2 Then
yn = MsgBox("月份不是二位数错误,请重输!", 48)
Else
If Val(montext.Text) < 1 Or Val(montext.Text) > 12 Then
yn = MsgBox("月份值在01-12之间,请重输!", 48)
Else
mon = Trim(montext.Text)
Set wdb = wws.OpenDatabase(xtlj + "dwxx.mdb")
Set wtb1 = wdb.OpenRecordset("月库登记", dbOpenTable)
wtb1.Index = "年月"
wtb1.Seek "=", ye, mon
If wtb1.NoMatch Then
wtb1.AddNew
wtb1("年") = ye
wtb1("月") = mon
wtb1.Update
dqklj = xtlj & "data\" & ye & mon & ".mdb"
FileCopy xtlj & "bzxx.mdb", dqklj
frmMAIN.StatusBar1.Panels(1).Text = " 注意:现在打开和处理的是" & ye & "年" & mon & "月的工资库"
dbdk = True
Else
yn = MsgBox(ye & "年" & mon & "月的工资库已经存在,是否打开?", 36)
If yn = vbYes Then
frmMAIN.StatusBar1.Panels(1).Text = " 注意:现在打开和处理的是" & ye & "年" & mon & "月的工资库!"
dqklj = xtlj & "data\" & ye & mon & ".mdb"
dbdk = True
Else
frmMAIN.StatusBar1.Panels(1).Text = "****未打开工资库!****"
End If
End If
Unload Me
End If
End If
End If
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub yeartext_Change()
If Len(yeartext.Text) = 4 Then
montext.SetFocus
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -