📄 frmpscb.frm
字号:
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 255
Left = 480
TabIndex = 32
Top = 3480
Width = 1335
End
Begin VB.Label Label16
Caption = "配送公里数"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 255
Left = 480
TabIndex = 31
Top = 2760
Width = 1215
End
Begin VB.Label Label5
Caption = "货品件数"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 255
Left = 600
TabIndex = 12
Top = 600
Width = 1095
End
Begin VB.Label Label4
Caption = "货品箱数发货数"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 495
Left = 600
TabIndex = 11
Top = 1200
Width = 975
End
Begin VB.Label Label3
Caption = "货贫盘数货品吨数"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 495
Left = 600
TabIndex = 10
Top = 1920
Width = 1095
End
End
Begin VB.CommandButton Command3
Caption = "打 印"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2640
Picture = "frmPSCB.frx":216F
Style = 1 'Graphical
TabIndex = 5
Top = 10320
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "添 加"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 600
Picture = "frmPSCB.frx":2C94
Style = 1 'Graphical
TabIndex = 4
Top = 10320
Width = 1095
End
Begin VB.TextBox Text1
BackColor = &H00E0E0E0&
Height = 270
Index = 0
Left = 2160
TabIndex = 3
Top = 720
Width = 1455
End
Begin VB.Label Label2
Caption = "货品编号"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 375
Left = 720
TabIndex = 2
Top = 1560
Width = 975
End
Begin VB.Label Label1
Caption = "货品名称"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 255
Left = 720
TabIndex = 1
Top = 720
Width = 1095
End
End
End
Attribute VB_Name = "frmPSFSJCB"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim db As ADODB.Connection
Dim rs As ADODB.Recordset
Private Sub Combo1_Click()
On Error Resume Next
Dim rs2 As ADODB.Recordset
Set rs2 = New ADODB.Recordset
rs.Close
rs.Open "select * from 货品信息 where 货品编号='" & Combo1.Text & "'", db, adOpenStatic, adLockReadOnly
Text1(0).Text = Trim(rs.Fields("货品名称").Value)
Text1(4).Text = Trim(rs.Fields("货品件数").Value)
Text1(2).Text = Trim(rs.Fields("发货数").Value)
Text1(1).Text = Trim(rs.Fields("货品总吨数").Value)
Text3(0).Text = Trim(rs.Fields("每公里费用").Value)
Text3(1).Text = Trim(rs.Fields("每吨费用").Value)
Text3(2).Text = Trim(rs.Fields("每材积费用").Value)
Text3(3).Text = Trim(rs.Fields("每车次费用").Value)
Text1(6).Text = Trim(rs.Fields("配送公里数").Value)
Text1(5).Text = Trim(rs.Fields("配送车次数").Value)
Text1(3).Text = Trim(rs.Fields("配送材积数").Value)
End Sub
Private Sub Command1_Click()
On Error Resume Next
rs.Close
rs.Open "update 货品信息 set 货品件数,发货数,货品总吨数,配送公里数,配送车次数,配送材积数,每公里费用,每吨费用,每材积费用,每车次费用='" & Trim(Text1(4).Text) & "','" & Trim(Text1(2).Text) & "','" & Trim(Text1(1).Text) & "','" & Trim(Text1(0).Text) & "','" & Trim(Text1(5).Text) & "','" & Trim(Text1(3).Text) & "','" & Trim(Text3(0).Text) & "','" & Trim(Text3(1).Text) & "','" & Trim(Text3(2).Text) & "','" & Trim(Text3(3).Text) & "'where 货位编号='" & Combo1.Text & "', db, adOpenStatic, adLockReadOnly"
End Sub
Private Sub Command4_Click()
If Option1.Value = True Then
Text2(1).Text = CInt(Text3(3).Text) * CSng(Text1(5).Text) / 10 & "0"
End If
If Option2.Value = True Then
Text2(1).Text = CInt(Text3(0).Text) * CInt(Text1(6).Text) / 10 & "0"
End If
If Option3.Value = True Then
Text2(1).Text = CInt(Text3(1).Text) * CInt(Text1(1).Text) / 10 & "0"
End If
If Option4.Value = True Then
Text2(1).Text = CInt(Text3(2).Text) * CInt(Text1(3).Text) / 10 & "0"
End If
End Sub
Private Sub Command5_Click()
rs.Close
rs.Open "select * from 货品信息", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = Adodc1
End Sub
Private Sub Command6_Click()
Unload Me
End Sub
Private Sub Form_Load()
Set db = New ADODB.Connection
Set rs = New ADODB.Recordset
db.ConnectionString = "driver={SQL Server};server=MAINSRV;database=物流系统"
db.Open
rs.Open "select * from 货品信息", db, adOpenStatic, adLockReadOnly
Dim i As String
For t = 0 To Val(rs.RecordCount) - 1
i = Trim(rs.Fields("货品编号").Value)
rs.MoveNext
Combo1.AddItem i
Next t
rs.Close
Me.Hide
MDIPSZX.Show
With Adodc1
.ConnectionString = "driver={SQL Server};server=MAINSRV;database=物流系统"
.RecordSource = "select * from 货品信息"
End With
Set DataGrid1.DataSource = Adodc1
End Sub
Private Sub Option1_Click()
Text2(0).Text = Text3(3).Text
End Sub
Private Sub Option2_Click()
Text2(0).Text = Text3(0).Text
End Sub
Private Sub Option3_Click()
Text2(0).Text = Text3(1).Text
End Sub
Private Sub Option4_Click()
Text2(0).Text = Text3(2).Text
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -