📄 form1.frm
字号:
Width = 975
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 = 12
Top = 1440
Width = 1095
End
Begin VB.Label Label15
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 = 11
Top = 600
Width = 1095
End
End
Begin VB.Frame Frame1
Caption = "货品装载特征"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000C0&
Height = 1935
Index = 0
Left = 240
TabIndex = 1
Top = 2640
Width = 5055
Begin VB.ComboBox Combo4
BackColor = &H0000FFFF&
ForeColor = &H00C00000&
Height = 360
ItemData = "Form1.frx":4E33
Left = 2160
List = "Form1.frx":4E3D
TabIndex = 42
Text = "Combo4"
Top = 600
Width = 1695
End
Begin VB.TextBox Text4
BackColor = &H00E0E0E0&
Height = 345
Left = 2160
TabIndex = 2
Top = 1320
Width = 1215
End
Begin VB.Label Label11
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 = 3600
TabIndex = 6
Top = 1440
Width = 1095
End
Begin VB.Label Label10
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 = 360
TabIndex = 5
Top = 1440
Width = 1575
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 = 600
TabIndex = 4
Top = 600
Width = 975
End
Begin VB.Label Label1
Height = 375
Index = 0
Left = 360
TabIndex = 3
Top = 600
Width = 15
End
End
End
End
Attribute VB_Name = "frmPCPSDD"
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(1).Text = Trim(rs.Fields("货品件数").Value)
rs2.Open "select * from 配车计划 where 货品编号='" & Combo1.Text & "'", db, adOpenStatic, adLockReadOnly
Text3.Text = Trim(rs2.Fields("配送车辆编号").Value)
Text2(0).Text = Trim(rs2.Fields("配送司机").Value)
Text2(1).Text = Trim(rs2.Fields("随车人员").Value)
Text2(2).Text = Trim(rs2.Fields("装车人员").Value)
End Sub
Private Sub Command1_Click(Index As Integer)
If Option1(1).Value = True Then
On Error Resume Next
rs.Close
rs.Open "select * from 货品信息 where 所用机具设备 like " & "'%" & Text1(2).Text & "%'", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = rs
End If
If Option2.Value = True Then
On Error Resume Next
rs.Close
rs.Open "select * from 货品信息 where 堆叠方式 like " & "'%" & Text1(2).Text & "%'", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = rs
End If
If Option3.Value = True Then
On Error Resume Next
rs.Close
rs.Open "select * from 货品信息where 装运配合作业 like " & "'%" & Text1(2).Text & "%'", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = rs
End If
If Option4.Value = True Then
On Error Resume Next
rs.Close
rs.Open "select * from 货品信息 where 装载所需时间 like " & "'%" & Text1(2).Text & "%'", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = rs
End If
End Sub
Private Sub Command2_Click(Index As Integer)
If Option11.Value = True Then
On Error Resume Next
rs.Close
rs.Open "update 货品信息 set 机具设备,堆叠方式,装载所需时间,装运配合作业='" & Combo3.Text & "','" & Combo4.Text & "','" & Trim(Text4.Text) & "','" & Option11.Caption & "'where 货位编号='" & Combo1.Text & "', db, adOpenStatic, adLockReadOnly"
lianjie
End If
If Option12.Value = True Then
On Error Resume Next
rs.Close
rs.Open "update 货品信息 set 机具设备,堆叠方式,装载所需时间,装运配合作业='" & Combo3.Text & "','" & Combo4.Text & "','" & Trim(Text4.Text) & "','" & Option12.Caption & "'where 货位编号='" & Combo1.Text & "', db, adOpenStatic, adLockReadOnly"
lianjie
End If
If Option13.Value = True Then
On Error Resume Next
rs.Close
rs.Open "update 货品信息 set 机具设备,堆叠方式,装载所需时间,装运配合作业='" & Combo3.Text & "','" & Combo4.Text & "','" & Trim(Text4.Text) & "','" & Option13.Caption & "'where 货位编号='" & Combo1.Text & "', db, adOpenStatic, adLockReadOnly"
lianjie
End If
If Option14.Value = True Then
On Error Resume Next
rs.Close
rs.Open "update 货品信息 set 机具设备,堆叠方式,装载所需时间,装运配合作业='" & Combo3.Text & "','" & Combo4.Text & "','" & Trim(Text4.Text) & "','" & Option14.Caption & "'where 货位编号='" & Combo1.Text & "', db, adOpenStatic, adLockReadOnly"
lianjie
End If
End Sub
Private Sub Command3_Click()
On Error Resume Next
rs.Close
rs.Open "select * from 货品信息", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = Adodc1
End Sub
Private Sub Command4_Click()
If Option11.Value = True Then
On Error Resume Next
rs.Close
rs.Open "update 货品信息 set 机具设备,堆叠方式,装载所需时间,装运配合作业='','','',''where 货位编号='" & Combo1.Text & "', db, adOpenStatic, adLockReadOnly"
lianjie
End If
If Option12.Value = True Then
On Error Resume Next
rs.Close
rs.Open "update 货品信息 set 机具设备,堆叠方式,装载所需时间,装运配合作业='','','',''where 货位编号='" & Combo1.Text & "', db, adOpenStatic, adLockReadOnly"
lianjie
End If
If Option13.Value = True Then
On Error Resume Next
rs.Close
rs.Open "update 货品信息 set 机具设备,堆叠方式,装载所需时间,装运配合作业='','','',''where 货位编号='" & Combo1.Text & "', db, adOpenStatic, adLockReadOnly"
lianjie
End If
If Option14.Value = True Then
On Error Resume Next
rs.Close
rs.Open "update 货品信息 set 机具设备,堆叠方式,装载所需时间,装运配合作业='','','',''where 货位编号='" & Combo1.Text & "', db, adOpenStatic, adLockReadOnly"
lianjie
End If
End Sub
Private Sub Command5_Click()
Unload Me
End Sub
Private Sub Command6_Click()
If Option11.Value = True Then
On Error Resume Next
rs.Close
rs.Open "update 货品信息 set 机具设备,堆叠方式,装载所需时间,装运配合作业='" & Combo3.Text & "','" & Combo4.Text & "','" & Trim(Text4.Text) & "','" & Option11.Caption & "'where 货位编号='" & Combo1.Text & "', db, adOpenStatic, adLockReadOnly"
lianjie
End If
If Option12.Value = True Then
On Error Resume Next
rs.Close
rs.Open "update 货品信息 set 机具设备,堆叠方式,装载所需时间,装运配合作业='" & Combo3.Text & "','" & Combo4.Text & "','" & Trim(Text4.Text) & "','" & Option12.Caption & "'where 货位编号='" & Combo1.Text & "', db, adOpenStatic, adLockReadOnly"
lianjie
End If
If Option13.Value = True Then
On Error Resume Next
rs.Close
rs.Open "update 货品信息 set 机具设备,堆叠方式,装载所需时间,装运配合作业='" & Combo3.Text & "','" & Combo4.Text & "','" & Trim(Text4.Text) & "','" & Option13.Caption & "'where 货位编号='" & Combo1.Text & "', db, adOpenStatic, adLockReadOnly"
lianjie
End If
If Option14.Value = True Then
On Error Resume Next
rs.Close
rs.Open "update 货品信息 set 机具设备,堆叠方式,装载所需时间,装运配合作业='" & Combo3.Text & "','" & Combo4.Text & "','" & Trim(Text4.Text) & "','" & Option14.Caption & "'where 货位编号='" & Combo1.Text & "', db, adOpenStatic, adLockReadOnly"
lianjie
End If
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
frmPCPSDD.Show
With Adodc1
.ConnectionString = "driver={SQL Server};server=MAINSRV;database=物流系统"
.RecordSource = "select * from 货品信息"
End With
Set DataGrid1.DataSource = Adodc1
End Sub
Private Sub Form_Unload(Cancel As Integer)
Me.Hide
MDIPSZX.Show
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -