?? form14.frm
字號:
VERSION 5.00
Begin VB.Form Form14
BorderStyle = 1 'Fixed Single
Caption = "Form14"
ClientHeight = 9375
ClientLeft = 45
ClientTop = 435
ClientWidth = 12870
LinkTopic = "Form14"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 9375
ScaleWidth = 12870
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command4
Caption = "打印合計欠款數據"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Left = 9000
TabIndex = 11
Top = 7920
Width = 2415
End
Begin VB.CommandButton Command3
Caption = "刪除帳本號"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Left = 1080
TabIndex = 10
Top = 8400
Width = 1775
End
Begin VB.ListBox List3
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1020
Left = 3000
TabIndex = 9
Top = 7920
Width = 1575
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
Left = 1080
TabIndex = 7
Text = "全 部"
Top = 7920
Width = 1775
End
Begin VB.CommandButton Command2
Caption = "打印明細欠款數據"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Left = 6600
TabIndex = 6
Top = 7920
Width = 2415
End
Begin VB.ListBox List2
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 6780
Left = 8520
TabIndex = 4
Top = 960
Width = 4095
End
Begin VB.CommandButton Command1
Caption = "刪除數據"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Left = 4800
TabIndex = 3
Top = 7920
Width = 1695
End
Begin VB.ListBox List1
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 6780
Left = 120
TabIndex = 1
Top = 960
Width = 8175
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "帳本號:"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 120
TabIndex = 8
Top = 7920
Width = 960
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = " 還款日期 還款金額"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 8520
TabIndex = 5
Top = 720
Width = 2880
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = " 制單日期 帳本號 帳單號 期初欠款金額 期內還款金額"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 120
TabIndex = 2
Top = 720
Width = 7680
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "欠款查詢畫面"
BeginProperty Font
Name = "宋體"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 3600
TabIndex = 0
Top = 240
Width = 1890
End
End
Attribute VB_Name = "Form14"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim f_current_row
Dim f_reckon_table(1000, 10), f_repay_table(1000, 7), f_all
Private Sub Combo1_Click()
If Combo1.Text = "全 部" Then
f_all = True
List3.Clear
For i = 0 To Combo1.ListCount - 1
j = 0
If Combo1.List(i) <> "全 部" Then
List3.AddItem Combo1.List(i), j
j = j + 1
End If
Next
Else
If f_all = True Then
List3.Clear
f_all = False
End If
For i = 0 To List3.ListCount - 1
If List3.List(i) = Combo1.Text Then
GoSub exit_combo1_click
End If
Next
List3.AddItem Combo1.Text, List3.ListCount
End If
List3.ListIndex = 0
exit_combo1_click:
End Sub
Private Sub Command1_Click()
t_YesNo = MsgBox("是否確認刪除", vbYesNo)
If t_YesNo = 7 Then
GoSub exit_Command1_Click
End If
If List2.ListCount = 0 Then
MsgBox ("沒有對應數據")
GoSub exit_Command1_Click
End If
Dim cnn1 As ADODB.Connection
Dim cmd1 As ADODB.Command
Dim rs1 As ADODB.Recordset
Set cnn1 = New ADODB.Connection
cnn1.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Documents and Settings\jujumao\My Documents\粵豐飼料\粵豐飼料經營情況.mdb;"
Set cmd1 = New ADODB.Command
SQL = "update 帳單表 set 還款金額=" & (f_reckon_table(f_current_row, 8) - f_repay_table(List2.ListIndex, 6)) & " where 帳單號 = " & _
"'" & f_reckon_table(f_current_row, 5) & "'" & " and 帳本號= " & "'" & f_reckon_table(f_current_row, 4) & "'"
With cmd1
.ActiveConnection = cnn1
.CommandText = SQL
.CommandType = adCmdText
.Execute
End With
SQL = "delete from 欠款收回表 where 編號 =" & f_repay_table(List2.ListIndex, 0)
With cmd1
.ActiveConnection = cnn1
.CommandText = SQL
.CommandType = adCmdText
.Execute
End With
SQL = "select * from 欠款收回表 where 帳單號 = " & _
"'" & f_reckon_table(f_current_row, 5) & "'" & " and 帳本號= " & "'" & f_reckon_table(f_current_row, 4) & "'"
With cmd1
.ActiveConnection = cnn1
.CommandText = SQL
.CommandType = adCmdText
End With
Set rs1 = cmd1.Execute
List2.Clear
If rs1.EOF Then
cnn1.Close
Set cnn1 = Nothing
GoTo exit_Command1_Click
End If
j = 0
rs1.MoveFirst
While Not rs1.EOF
S = ""
For i = 0 To rs1.Fields.Count - 1
Select Case i
Case 3
date_string = Round(rs1.Fields(3).Value, 0) & "年" & _
Round(rs1.Fields(4).Value, 0) & "月" & _
Round(rs1.Fields(5).Value, 0) & "日"
t_len = 12 - Len(date_string)
S1 = ""
For t = 1 To t_len
S1 = S1 & " "
Next
S = S & date_string & S1
Case 6
t_len = 0
t_value = Round(rs1.Fields(i).Value, 2)
t_len = 11 - Len(t_value)
S1 = ""
If t_value = Int(t_value) Then
S1 = S1 & ".00"
t_len = t_len - 3
Else
If (t_value * 10) = Int(t_value * 10) Then
S1 = S1 & "0"
t_len = t_len - 1
End If
End If
For t = 1 To t_len
S1 = S1 & " "
Next
S = S & t_value & S1
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -