📄 frmaccrual.frm
字号:
VERSION 5.00
Begin VB.Form frmAccrual
BackColor = &H80000007&
Caption = "Form1"
ClientHeight = 3585
ClientLeft = 60
ClientTop = 345
ClientWidth = 3645
LinkTopic = "Form1"
ScaleHeight = 3585
ScaleWidth = 3645
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox txt
Enabled = 0 'False
Height = 270
Index = 0
Left = 840
TabIndex = 8
Top = 120
Width = 2175
End
Begin VB.TextBox txt
Enabled = 0 'False
Height = 270
Index = 1
Left = 840
TabIndex = 7
Top = 600
Width = 2175
End
Begin VB.TextBox txt
Enabled = 0 'False
Height = 270
Index = 2
Left = 840
TabIndex = 6
Top = 1080
Width = 2175
End
Begin VB.TextBox txt
Enabled = 0 'False
Height = 270
Index = 3
Left = 840
TabIndex = 5
Top = 1560
Width = 2175
End
Begin VB.TextBox txt
Enabled = 0 'False
Height = 270
Index = 5
Left = 840
TabIndex = 4
Top = 2040
Width = 2175
End
Begin VB.TextBox txt
Enabled = 0 'False
Height = 270
Index = 8
Left = 840
TabIndex = 3
Top = 2520
Width = 2175
End
Begin VB.CommandButton cmdSave
Caption = "保 存"
Default = -1 'True
Enabled = 0 'False
Height = 345
Left = 120
TabIndex = 2
Top = 3120
Width = 975
End
Begin VB.CommandButton cmdUpdate
Caption = "修 改"
Height = 345
Left = 1320
TabIndex = 1
Top = 3120
Width = 975
End
Begin VB.CommandButton cmdClose
Cancel = -1 'True
Caption = "关 闭"
Height = 345
Left = 2520
TabIndex = 0
Top = 3120
Width = 975
End
Begin VB.Label lbl
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "活期:"
ForeColor = &H00FFFFFF&
Height = 180
Index = 0
Left = 240
TabIndex = 14
Top = 240
Width = 540
End
Begin VB.Label lbl
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "二年:"
ForeColor = &H00FFFFFF&
Height = 180
Index = 2
Left = 240
TabIndex = 13
Top = 1200
Width = 540
End
Begin VB.Label lbl
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "一年:"
ForeColor = &H00FFFFFF&
Height = 180
Index = 3
Left = 240
TabIndex = 12
Top = 720
Width = 540
End
Begin VB.Label lbl
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "五年:"
ForeColor = &H00FFFFFF&
Height = 180
Index = 4
Left = 240
TabIndex = 11
Top = 2160
Width = 540
End
Begin VB.Label lbl
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "三年:"
ForeColor = &H00FFFFFF&
Height = 180
Index = 5
Left = 240
TabIndex = 10
Top = 1680
Width = 540
End
Begin VB.Label lbl
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "八年:"
ForeColor = &H00FFFFFF&
Height = 180
Index = 1
Left = 240
TabIndex = 9
Top = 2640
Width = 540
End
End
Attribute VB_Name = "frmAccrual"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdSave_Click()
Dim theAccrual As Double
Dim accrualDouble As Boolean
accrualDouble = False
On Error GoTo err1
For i = 0 To 3
theAccrual = CDbl(txt(i).Text)
Next i
theAccrual = CDbl(txt(5).Text)
theAccrual = CDbl(txt(8).Text)
accrualDouble = True
err1:
If Not accrualDouble Then
MsgBox "请确定你所输入的是数字!"
Exit Sub
End If
Dim rst As New Recordset
Call LinkDB(landWay, SName, "weboy", SUName, SUPw)
con.Open
Dim errGet As Boolean
errGet = True
On Error GoTo errGoto
rst.Open "select * from accrual", con, adOpenDynamic, adLockOptimistic
rst.MoveFirst
rst.Close
errGet = False
errGoto:
If errGet Then
con.Execute "insert accrual values('0','" & CDbl(txt(0).Text) & "')"
con.Execute "insert accrual values('1','" & CDbl(txt(1).Text) & "')"
con.Execute "insert accrual values('2','" & CDbl(txt(2).Text) & "')"
con.Execute "insert accrual values('3','" & CDbl(txt(3).Text) & "')"
con.Execute "insert accrual values('5','" & CDbl(txt(5).Text) & "')"
con.Execute "insert accrual values('8','" & CDbl(txt(8).Text) & "')"
Else
con.Execute "update accrual set percentage=" & CDbl(txt(0).Text) & " where theYear='0'"
con.Execute "update accrual set percentage=" & CDbl(txt(1).Text) & " where theYear='1'"
con.Execute "update accrual set percentage=" & CDbl(txt(2).Text) & " where theYear='2'"
con.Execute "update accrual set percentage=" & CDbl(txt(3).Text) & " where theYear='3'"
con.Execute "update accrual set percentage=" & CDbl(txt(5).Text) & " where theYear='5'"
con.Execute "update accrual set percentage=" & CDbl(txt(8).Text) & " where theYear='8'"
End If
con.Close
percentage0 = CDbl(txt(0).Text)
percentage1 = CDbl(txt(1).Text)
percentage2 = CDbl(txt(2).Text)
percentage3 = CDbl(txt(3).Text)
percentage5 = CDbl(txt(5).Text)
percentage8 = CDbl(txt(8).Text)
MsgBox "保存成功!"
Unload Me
Me.Show
End Sub
Private Sub cmdUpdate_Click()
For i = 0 To 3
txt(i).Enabled = True
Next i
txt(5).Enabled = True
txt(8).Enabled = True
cmdSave.Enabled = True
End Sub
Private Sub Form_Load()
txt(0).Text = percentage0
txt(1).Text = percentage1
txt(2).Text = percentage2
txt(3).Text = percentage3
txt(5).Text = percentage5
txt(8).Text = percentage8
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -