📄 frmclfh.frm
字号:
Begin VB.Label Label23
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 = 3600
TabIndex = 14
Top = 360
Width = 495
End
Begin VB.Label Label25
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 = 1440
TabIndex = 12
Top = 360
Width = 495
End
Begin VB.Label Label22
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 = 615
Index = 0
Left = 480
TabIndex = 11
Top = 480
Width = 615
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
Index = 0
Left = 480
TabIndex = 9
Top = 2520
Width = 1575
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 = 480
TabIndex = 8
Top = 1440
Width = 975
End
Begin VB.Label Label2
Caption = "K g"
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 = 3960
TabIndex = 7
Top = 1440
Width = 495
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 = 255
Left = 3960
TabIndex = 6
Top = 2520
Width = 735
End
End
Begin VB.Frame Frame3
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 = 3015
Left = 11160
TabIndex = 3
Top = 600
Width = 3615
Begin VB.OptionButton Option10
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 = 50
Top = 2160
Width = 2415
End
Begin VB.OptionButton Option9
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 = 49
Top = 1440
Width = 2415
End
Begin VB.OptionButton Option8
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 = 48
Top = 720
Width = 2415
End
End
Begin VB.Frame Frame2
Height = 1575
Left = 4320
TabIndex = 1
Top = 3600
Width = 4575
Begin VB.ComboBox Combo1
BackColor = &H0000FFFF&
ForeColor = &H00C00000&
Height = 300
ItemData = "frmCLFH.frx":4E03
Left = 2520
List = "frmCLFH.frx":4E0D
TabIndex = 56
Text = "Combo1"
Top = 720
Width = 1335
End
Begin VB.Label Label7
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 = 2
Top = 720
Width = 1575
End
End
End
End
Attribute VB_Name = "frmPSPCGH"
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 Command1_Click(Index As Integer)
If Option1.Value = True Then
On Error Resume Next
rs.Close
rs.Open "select * from 配车计划 where 配送车辆编号 like " & "'%" & Text1(1).Text & "%'", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = rs
End If
If Option2(0).Value = True Then
On Error Resume Next
rs.Close
rs.Open "select * from 配车计划 where 货品名称 like " & "'%" & Text1(1).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(1).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(1).Text & "%'", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = rs
End If
If Option5.Value = True Then
On Error Resume Next
rs.Close
rs.Open "select * from 配车计划 where 发货时间 like " & "'%" & Text1(1).Text & "%'", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = rs
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 Command5_Click()
If Text5(3) = "" Then
MsgBox "货品名称不能为空!", vbExclamation, "提示"
ElseIf Text5(10) = "" Then
MsgBox "货品编号不能为空!", vbExclamation, "提示"
ElseIf Text5(2) = "" Then
MsgBox "货品状态不能为空!", vbExclamation, "提示"
ElseIf Text3 = "" Then
MsgBox "货品体积不能为空!", vbExclamation, "提示"
ElseIf Text4 = "" Then
MsgBox "配送车辆量数不能为空!", vbExclamation, "提示"
ElseIf Text5(0) = "" Then
MsgBox "配送车辆编号不能为空!", vbExclamation, "提示"
ElseIf Text5(8) = "" Then
MsgBox "配送地区代码不能为空!", vbExclamation, "提示"
ElseIf Text5(5) = "" Then
MsgBox "驾驶员姓名不能为空!", vbExclamation, "提示"
ElseIf Text5(4) = "" Then
MsgBox "驾驶员编号不能为空!", vbExclamation, "提示"
End If
'GoTo er
If Option8.Value = False And Option9.Value = False And Option10.Value = False Then
MsgBox "请选择车辆来源"
GoTo er
End If
If Option8.Value = True Then
On Error Resume Next
rs.Close
rs.Open "insert into 配车计划(货品名称,货品编号,货品重量,货品状态,货品体积,货品件数,发货时间,到货时间,配送地区代码,车辆来源,配送车辆编号,配备卸载工具,配送车辆数量,配送次数,配送司机,配送司机编号)values('" & Trim(Text5(3).Text) & "','" & Trim(Text5(10).Text) & "','" & Trim(Text1(0).Text) & "','" & Trim(Text5(2).Text) & "','" & Trim(Text3.Text) & "','" & Trim(Text2.Text) & "','" & DTPicker1.Value & "','" & DTPicker2.Value & "','" & Trim(Text5(8).Text) & "','" & Option8.Caption & "','" & Trim(Text5(0).Text) & "','" & Combo1.Text & "','" & Trim(Text4.Text) & "','" & Trim(Text5(9).Text) & "','" & Trim(Text5(5).Text) & "','" & Trim(Text5(4).Text) & "')", db, adOpenStatic, adLockReadOnly
End If
If Option9.Value = True Then
On Error Resume Next
rs.Close
rs.Open "insert into 配车计划(货品名称,货品编号,货品重量,货品状态,货品体积,货品件数,发货时间,到货时间,配送地区代码,车辆来源,配送车辆编号,配备卸载工具,配送车辆数量,配送次数,配送司机,配送司机编号)values('" & Trim(Text5(3).Text) & "','" & Trim(Text5(10).Text) & "','" & Trim(Text1(0).Text) & "','" & Trim(Text5(2).Text) & "','" & Trim(Text3.Text) & "','" & Trim(Text2.Text) & "','" & DTPicker1.Value & "','" & DTPicker2.Value & "','" & Trim(Text5(8).Text) & "','" & Option9.Caption & "','" & Trim(Text5(0).Text) & "','" & Combo1.Text & "','" & Trim(Text4.Text) & "','" & Trim(Text5(9).Text) & "','" & Trim(Text5(5).Text) & "','" & Trim(Text5(4).Text) & "')", db, adOpenStatic, adLockReadOnly
End If
If Option10.Value = True Then
On Error Resume Next
rs.Close
rs.Open "insert into 配车计划(货品名称,货品编号,货品重量,货品状态,货品体积,货品件数,发货时间,到货时间,配送地区代码,车辆来源,配送车辆编号,配备卸载工具,配送车辆数量,配送次数,配送司机,配送司机编号)values('" & Trim(Text5(3).Text) & "','" & Trim(Text5(10).Text) & "','" & Trim(Text1(0).Text) & "','" & Trim(Text5(2).Text) & "','" & Trim(Text3.Text) & "','" & Trim(Text2.Text) & "','" & DTPicker1.Value & "','" & DTPicker2.Value & "','" & Trim(Text5(8).Text) & "','" & Option10.Caption & "','" & Trim(Text5(0).Text) & "','" & Combo1.Text & "','" & Trim(Text4.Text) & "','" & Trim(Text5(9).Text) & "','" & Trim(Text5(5).Text) & "','" & Trim(Text5(4).Text) & "')", db, adOpenStatic, adLockReadOnly
End If
Text5(3) = ""
Text5(10) = ""
Text1(0) = ""
Text5(2) = ""
Text3 = ""
Text2 = ""
Text5(8) = ""
Text5(0) = ""
Text4 = ""
Text5(9) = ""
Text5(5) = ""
Text5(4) = ""
Text5(3).SetFocus
er:
End Sub
Private Sub Command6_Click()
On Error Resume Next
rs.Close
rs.Open "delete 配车计划 where 货品名称='" & Trim(Text5(3).Text) & "'", db, adOpenStatic, adLockReadOnly
End Sub
Private Sub Command7_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
Me.Hide
frmPSPCGH.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 + -