?? frm_borrowgo.frm
字號(hào):
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form frm_borrowgo
BackColor = &H0080C0FF&
Caption = "借出款"
ClientHeight = 4065
ClientLeft = 60
ClientTop = 345
ClientWidth = 5055
Icon = "frm_borrowgo.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 4065
ScaleWidth = 5055
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command4
Caption = "末條"
Height = 300
Left = 3360
TabIndex = 19
Top = 3600
Width = 735
End
Begin VB.CommandButton Command3
Caption = "下一條"
Height = 300
Left = 2640
TabIndex = 18
Top = 3600
Width = 735
End
Begin VB.CommandButton Command2
Caption = "上一條"
Height = 300
Left = 1920
TabIndex = 17
Top = 3600
Width = 735
End
Begin VB.CommandButton Command1
Caption = "首條"
Height = 300
Left = 1200
TabIndex = 16
Top = 3600
Width = 735
End
Begin VB.CheckBox Check1
BackColor = &H0080C0FF&
Caption = "已還"
Height = 255
Left = 960
TabIndex = 15
Top = 2760
Width = 1095
End
Begin VB.CommandButton cmd_close
Caption = "關(guān)閉"
Height = 300
Left = 3360
TabIndex = 14
Top = 3120
Width = 735
End
Begin VB.CommandButton cmd_del
Caption = "刪除"
Height = 300
Left = 2640
TabIndex = 13
Top = 3120
Width = 735
End
Begin VB.CommandButton cmd_edit
Caption = "修改"
Height = 300
Left = 1920
TabIndex = 12
Top = 3120
Width = 735
End
Begin VB.CommandButton cdm_add
Caption = "添加"
Height = 300
Left = 1200
TabIndex = 11
Top = 3120
Width = 735
End
Begin VB.Frame Frame1
BackColor = &H0080C0FF&
Height = 2175
Left = 0
TabIndex = 0
Top = 360
Width = 5055
Begin VB.ComboBox Combo1
Height = 300
Left = 960
TabIndex = 5
Top = 720
Width = 1215
End
Begin VB.TextBox txt_money
Height = 300
Left = 3360
TabIndex = 4
Top = 240
Width = 1335
End
Begin VB.TextBox txt_man
Height = 300
Left = 960
TabIndex = 3
Top = 240
Width = 1215
End
Begin VB.TextBox txt_way
Height = 735
Left = 960
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 1
Top = 1200
Width = 3735
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 300
Left = 3360
TabIndex = 2
Top = 720
Width = 1335
_ExtentX = 2355
_ExtentY = 529
_Version = 393216
Format = 24641537
CurrentDate = 37819
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "得款人:"
Height = 255
Left = 120
TabIndex = 10
Top = 240
Width = 855
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "借款金額:"
Height = 255
Left = 2400
TabIndex = 9
Top = 240
Width = 975
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "出借人:"
Height = 255
Left = 120
TabIndex = 8
Top = 720
Width = 855
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "借款日期:"
Height = 255
Left = 2400
TabIndex = 7
Top = 720
Width = 1095
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "借款原因:"
Height = 255
Left = 120
TabIndex = 6
Top = 1200
Width = 1095
End
End
Begin VB.Label Label8
BackStyle = 0 'Transparent
Caption = "記錄"
Height = 255
Left = 1560
TabIndex = 22
Top = 120
Width = 495
End
Begin VB.Label Label7
BackStyle = 0 'Transparent
Height = 255
Left = 1200
TabIndex = 21
Top = 120
Width = 615
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "當(dāng)前共有:"
Height = 255
Left = 240
TabIndex = 20
Top = 120
Width = 975
End
End
Attribute VB_Name = "frm_borrowgo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Mydb As New ADODB.Recordset
Dim Mydb1 As New ADODB.Recordset
Dim Str_text As String
Private Sub cdm_add_Click()
On Error Resume Next
Dim A As Boolean
A = MsgBox("是否添加前記錄?", vbYesNo + 32, "添加記錄")
If A = True Then
ExeCutesql "insert into 借出 values('" & txt_man.Text & "','" & txt_money.Text & "','" & Combo1.Text & "','" & DTPicker1.Value & "','" & txt_way.Text & "','" & Check1.Value & "')", Str_text
MsgBox "數(shù)據(jù)已經(jīng)保存!", vbOKOnly + 64, "成功"
Call Db
Label7.Caption = Mydb.RecordCount
End If
End Sub
Private Sub cmd_close_Click()
Unload Me
End Sub
Private Sub cmd_del_Click()
Dim A As Boolean
A = MsgBox("是否真的要?jiǎng)h除這條記錄?", vbOKCancel + 32 + 256, "刪除")
If A = True Then
ExeCutesql "delete from 借出 where 得款人='" & txt_man.Text & "'", Str_text
MsgBox "記錄已刪除!", , "刪除"
If Mydb.RecordCount > 0 Then
Mydb.MoveNext
If Mydb.EOF Then Mydb.MoveLast
Call Db
Call Bangding
Label7.Caption = Mydb.RecordCount
End If
End If
End Sub
Private Sub cmd_edit_Click()
On Error Resume Next
Dim A As Boolean
A = MsgBox("是否修改前記錄?", vbYesNo + 32, "添加記錄")
If A = True Then
Mydb.Update
'Mydb.Requery
Call Db
MsgBox "數(shù)據(jù)修改成功!", vbOKOnly + 64, "成功"
End If
End Sub
Private Sub Combo1_Change()
Dim A As Integer
Set Mydb1 = ExeCutesql("select 姓名 from 成員", Str_text)
'Set Combo1.DataSource = Mydb1
A = Mydb1.RecordCount
For I = 1 To A
Combo1.AddItem Mydb1.Fields(0)
Mydb1.MoveNext
If Mydb1.EOF Then Exit For
Next I
End Sub
Private Sub Command1_Click()
On Error Resume Next
'Call Db
Mydb.MoveFirst
Call Bangding
End Sub
Private Sub Command2_Click()
On Error Resume Next
'Call Db
'If Not Mydb.BOF Then Mydb.MovePrevious
Mydb.MovePrevious
If Mydb.BOF Then
MsgBox "這已經(jīng)是第一條記錄了!", vbOKOnly + 32, "注意"
Mydb.MoveFirst
End If
Call Bangding
End Sub
Private Sub Command3_Click()
On Error Resume Next
'Call Db
'Mydb.MovePrevious
'If Mydb.BOF Then
' MsgBox "這已經(jīng)是第一條記錄了!", vbOKOnly + 32, "注意"
' Mydb.MoveFirst
'End If
Mydb.MoveNext
If Mydb.EOF Then
MsgBox "這已經(jīng)是最后一條記錄了!", vbOKOnly + 32, "注意"
Mydb.MoveLast
End If
Call Bangding
End Sub
Private Sub Command4_Click()
On Error Resume Next
'Call Db
Mydb.MoveLast
Call Bangding
End Sub
Private Sub Form_Load()
On Error Resume Next
'Set Mydb = ExeCutesql("select * from 借出", Str_text)
Call Db
'Call Bangding
Check1.Value = 0
Label7.Caption = Mydb.RecordCount
DTPicker1.Value = Date
End Sub
Private Function Db()
On Error Resume Next
Set Mydb = ExeCutesql("select * from 借出", Str_text)
End Function
Private Function Bangding()
On Error Resume Next
Set txt_man.DataSource = Mydb
Set txt_money.DataSource = Mydb
Set DTPicker1.DataSource = Mydb
Set txt_way.DataSource = Mydb
Set Check1.DataSource = Mydb
txt_man.DataField = "得款人"
txt_money.DataField = "金額"
DTPicker1.Value = "日期"
txt_way.DataField = "借款原因"
Check1.DataField = "已還"
Set Combo1.DataSource = Mydb
Combo1.DataField = "出借人"
End Function
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -