📄 frmoperedit.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form FrmOperEdit
Caption = "编辑银行往来信息"
ClientHeight = 4710
ClientLeft = 60
ClientTop = 345
ClientWidth = 5865
LinkTopic = "Form1"
ScaleHeight = 4710
ScaleWidth = 5865
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox txtMonth
Height = 330
Left = 3960
TabIndex = 19
Top = 1707
Width = 1335
End
Begin VB.ComboBox cob_Flag
Height = 300
Left = 1320
Style = 2 'Dropdown List
TabIndex = 18
Top = 744
Width = 1335
End
Begin VB.TextBox txtSum
Height = 330
Left = 1320
TabIndex = 13
Top = 1707
Width = 1335
End
Begin MSAdodcLib.Adodc Ado_Bank
Height = 330
Left = 3480
Top = 3720
Visible = 0 'False
Width = 2055
_ExtentX = 3625
_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 = "Ado_Bank"
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 MSDataListLib.DataCombo dco_Bank
Height = 330
Left = 1320
TabIndex = 12
Top = 240
Width = 3975
_ExtentX = 7011
_ExtentY = 582
_Version = 393216
Style = 2
Text = ""
End
Begin MSAdodcLib.Adodc Ado_Mem
Height = 330
Left = 0
Top = 3720
Visible = 0 'False
Width = 2055
_ExtentX = 3625
_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 = "Ado_Mem"
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 MSDataListLib.DataCombo dco_Mem
Height = 330
Left = 3960
TabIndex = 11
Top = 2196
Width = 1335
_ExtentX = 2355
_ExtentY = 582
_Version = 393216
Style = 2
Text = ""
End
Begin VB.TextBox txtMemo
Height = 810
Left = 1320
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 9
Top = 2760
Width = 3975
End
Begin VB.CommandButton Cmd_Cancel
Caption = "取 消"
Height = 375
Left = 3600
TabIndex = 6
Top = 4080
Width = 1215
End
Begin VB.CommandButton Cmd_OK
Caption = "确 定"
Height = 375
Left = 1320
TabIndex = 5
Top = 4080
Width = 1215
End
Begin VB.TextBox txtODate
Height = 330
Left = 3960
TabIndex = 4
Top = 729
Width = 1335
End
Begin VB.TextBox txtInterest
Height = 330
Left = 1320
TabIndex = 3
Top = 2196
Width = 1335
End
Begin MSDataListLib.DataCombo dco_Acc
Height = 330
Left = 1320
TabIndex = 16
Top = 1230
Width = 3975
_ExtentX = 7011
_ExtentY = 582
_Version = 393216
Style = 2
Text = ""
End
Begin MSAdodcLib.Adodc Ado_Acc
Height = 330
Left = 2160
Top = 4200
Visible = 0 'False
Width = 2055
_ExtentX = 3625
_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 = "Ado_Acc"
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.Label Label9
AutoSize = -1 'True
Caption = "交易类型"
Height = 180
Left = 360
TabIndex = 17
Top = 804
Width = 720
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "选择账号"
Height = 180
Left = 360
TabIndex = 15
Top = 1293
Width = 720
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "交易金额"
Height = 180
Left = 360
TabIndex = 14
Top = 1782
Width = 720
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "说明"
Height = 180
Left = 720
TabIndex = 10
Top = 2760
Width = 360
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "交易日期"
Height = 180
Left = 3000
TabIndex = 8
Top = 804
Width = 720
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "操作人姓名"
Height = 180
Left = 2820
TabIndex = 7
Top = 2271
Width = 900
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "银行名称"
Height = 180
Left = 360
TabIndex = 2
Top = 315
Width = 720
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "定期月份"
Height = 180
Left = 3000
TabIndex = 1
Top = 1782
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "实际利息"
Height = 180
Left = 360
TabIndex = 0
Top = 2271
Width = 720
End
End
Attribute VB_Name = "FrmOperEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public OriOId As Long
Public Modify As Boolean
Public OldSum As Double '记录原始交易金额
Public DSum As Double '差值
Private Sub Cmd_Cancel_Click()
Unload Me
End Sub
Private Sub Cmd_OK_Click()
Dim TId As Long
If Len(Trim(dco_Bank.Text)) = 0 Then
MsgBox "请选择交易银行"
dco_Bank.SetFocus
Exit Sub
End If
If Len(Trim(cob_Flag.Text)) = 0 Then
MsgBox "请选择交易类型"
cob_Flag.SetFocus
Exit Sub
End If
If Len(Trim(dco_Acc.Text)) = 0 Then
MsgBox "请选择银行账号"
dco_Acc.SetFocus
Exit Sub
End If
If Len(Trim(txtODate)) = 0 Then
MsgBox "请输入交易日期"
txtODate.SetFocus
Exit Sub
End If
If Len(Trim(txtSum)) = 0 Then
MsgBox "请输入交易金额"
txtSum.SetFocus
Exit Sub
End If
If Len(Trim(dco_Mem.Text)) = 0 Then
MsgBox "请选择操作人姓名"
dco_Mem.SetFocus
Exit Sub
End If
'当交易类型为取款(1)时,选择帐户信息后,需要判断是否此账号金额是否足够
If MyAcc.GetInfo(Trim(dco_Acc.BoundText())) And MyAcc.ASum < Val(txtSum) _
And cob_Flag.ListIndex = 1 Then
MsgBox "帐户余额不足,请重新选择交易帐户"
dco_Acc.SetFocus
Exit Sub
End If
With MyOper
.BId = Val(dco_Bank.BoundText())
.MemId = Val(dco_Mem.BoundText())
.OperDate = Trim(txtODate)
.ANo = Trim(dco_Acc.BoundText())
.OperSum = Val(txtSum)
.SMonth = Val(txtMonth)
.Interest = Val(txtInterest)
.Memos = Trim(txtMemo)
.Flag = cob_Flag.ListIndex
If Modify = False Then
.Insert
MsgBox "添加成功"
Else
.Update (OriOId)
MsgBox "修改成功"
End If
End With
'对比现在的金额和原来的金额
DSum = Val(txtSum) - OldSum
'更改后将更新对应的帐户信息
If cob_Flag.ListIndex = 0 Then '存款
MyAcc.UpdateSum Trim(dco_Acc.Text), 0, DSum
ElseIf cob_Flag.ListIndex = 1 Then '取款
MyAcc.UpdateSum Trim(dco_Acc.Text), 1, 0 - DSum
Else '清户
'清空帐户金额
MyAcc.UpdateSum Trim(dco_Acc.Text), 2, 0
End If
Unload Me
End Sub
Private Sub dco_Acc_Click(Area As Integer)
'当选择的账号为活期帐户,则定期月份和利息都不可用
If Len(Trim(dco_Acc.Text)) > 0 Then
MyAcc.GetInfo (Trim(dco_Acc.Text))
If MyAcc.Flag = 0 Then '活期
txtMonth.Enabled = False
txtInterest.Enabled = False
Else '定期
txtMonth.Enabled = True
txtInterest.Enabled = True
End If
End If
End Sub
Private Sub dco_Bank_Click(Area As Integer)
'根据选择的银行编号读取对应的帐户信息
If Len(Trim(dco_Bank.Text)) <> 0 Then
'载入帐户信息
Ado_Acc.ConnectionString = Conn
Ado_Acc.RecordSource = "Select AccountNo From Account Where BId=" _
+ Trim(dco_Bank.BoundText()) + " Order By AccountNo"
Ado_Acc.Refresh
Set dco_Acc.RowSource = Ado_Acc
dco_Acc.ListField = "AccountNo"
dco_Acc.BoundColumn = "AccountNo"
Else
dco_Acc.Text = ""
End If
End Sub
Private Sub Form_Load()
cob_Flag.AddItem "存款", 0
cob_Flag.AddItem "取款", 1
cob_Flag.AddItem "清户", 2
cob_Flag.ListIndex = 0
'载入银行信息
Ado_Bank.ConnectionString = Conn
Ado_Bank.RecordSource = "Select * From Banks Order By BankId"
Ado_Bank.Refresh
Set dco_Bank.RowSource = Ado_Bank
dco_Bank.ListField = "BankName"
dco_Bank.BoundColumn = "BankId"
'载入家庭成员信息
Ado_Mem.ConnectionString = Conn
Ado_Mem.RecordSource = "Select * From Members Order By MemId"
Ado_Mem.Refresh
Set dco_Mem.RowSource = Ado_Mem
dco_Mem.ListField = "MemName"
dco_Mem.BoundColumn = "MemId"
'载入帐户信息
Ado_Acc.ConnectionString = Conn
Ado_Acc.RecordSource = "Select AccountNo From Account Order By AccountNo"
Ado_Acc.Refresh
Set dco_Acc.RowSource = Ado_Acc
dco_Acc.ListField = "AccountNo"
dco_Acc.BoundColumn = "AccountNo"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -