?? form12.frm
字號:
VERSION 5.00
Begin VB.Form Form12
BorderStyle = 1 'Fixed Single
Caption = "Form12"
ClientHeight = 9015
ClientLeft = 45
ClientTop = 435
ClientWidth = 13560
LinkTopic = "Form12"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 9015
ScaleWidth = 13560
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "打印數(shù)據(jù)"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 540
Left = 8280
TabIndex = 5
Top = 8280
Width = 1695
End
Begin VB.CommandButton Command2
Caption = "修改數(shù)據(jù)"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 540
Left = 6480
TabIndex = 4
Top = 8280
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 = 7020
ItemData = "Form12.frx":0000
Left = 240
List = "Form12.frx":0002
TabIndex = 1
Top = 960
Width = 13005
End
Begin VB.CommandButton Command1
Caption = "確認(rèn)刪除"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 540
Left = 4560
TabIndex = 0
Top = 8280
Width = 1695
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "品種 售出日期 單號 斤數(shù) 單價 售出金額 帳本號 備注"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 360
TabIndex = 3
Top = 645
Width = 11040
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "品種售出明細(xì)查詢"
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 5760
TabIndex = 2
Top = 120
Width = 2280
End
End
Attribute VB_Name = "Form12"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim f_arr_number(500), f_formshow
Private Sub Command1_Click()
t_YesNo = MsgBox("是否確認(rèn)刪除", vbYesNo)
If t_YesNo = 7 Then
GoSub exit_Command1_Click
End If
Dim cnn1 As ADODB.Connection
Dim cmd1 As ADODB.Command
Dim rs1 As ADODB.Recordset
f_refresh = "NO"
Set cnn1 = New ADODB.Connection
cnn1.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Documents and Settings\jujumao\My Documents\粵豐飼料\粵豐飼料經(jīng)營情況.mdb;"
Set cmd1 = New ADODB.Command
SQL = "delete from 品種售出表 where 編號=" & f_arr_number(List1.ListIndex)
With cmd1
.ActiveConnection = cnn1
.CommandText = SQL
.CommandType = adCmdText
.Execute
End With
SQL = "select * from 品種售出表 where " & _
"品種 =" & "'" & g_breed & "'" & " and 年份 = " & g_year & "and 月份=" & g_month & " order by 帳本號,單號"
With cmd1
.ActiveConnection = cnn1
.CommandText = SQL
.CommandType = adCmdText
End With
Set rs1 = cmd1.Execute
j = 0
List1.Clear
If rs1.EOF Then
MsgBox ("沒有查詢到記錄")
Command1.Enabled = False
Command2.Enabled = False
cnn1.Close
Set cnn1 = Nothing
GoSub exit_Command1_Click
End If
rs1.MoveFirst
While Not rs1.EOF
S = ""
For i = 1 To rs1.Fields.Count - 1
Select Case i
Case 1
tt_len = Len(rs1.Fields(i).Value)
t_len = 0
For t = 1 To tt_len
If Asc((Mid((rs1.Fields(i).Value), t, 1))) < 0 Then
t_len = t_len + 2
Else
t_len = t_len + 1
End If
Next
t_len = 16 - t_len
S1 = ""
For t = 1 To t_len
S1 = S1 & " "
Next
S = S & rs1.Fields(i).Value & S1
Case 5, 10, 11
tt_len = Len(rs1.Fields(i).Value)
t_len = 0
For t = 1 To tt_len
If Asc((Mid((rs1.Fields(i).Value), t, 1))) < 0 Then
t_len = t_len + 2
Else
t_len = t_len + 1
End If
Next
t_len = 12 - t_len
S1 = ""
For t = 1 To t_len
S1 = S1 & " "
Next
S = S & rs1.Fields(i).Value & S1
Case 7
t_len = 0
t_value = Round(rs1.Fields(i).Value, 3)
t_len = 11 - Len(t_value)
S1 = ""
If t_value = Int(t_value) Then
S1 = S1 & ".000"
t_len = t_len - 4
Else
If (t_value * 10) = Int(t_value * 10) Then
S1 = S1 & "00"
t_len = t_len - 2
Else
If (t_value * 100) = Int(t_value * 100) Then
S1 = S1 & "0"
t_len = t_len - 1
End If
End If
End If
If t_value < 1 And t_value > 0 Then
S = S & "0"
t_len = t_len - 1
End If
For t = 1 To t_len
S1 = S1 & " "
Next
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -