📄 frmpshpxx.frm
字号:
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 1
Left = 360
Picture = "frmPSHPXX.frx":2C94
Style = 1 'Graphical
TabIndex = 32
Top = 6120
Width = 975
End
Begin VB.OptionButton Option1
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 = 1080
TabIndex = 7
Top = 720
Width = 1455
End
Begin VB.OptionButton Option1
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 = 1
Left = 1080
TabIndex = 6
Top = 1440
Width = 1335
End
Begin VB.OptionButton Option1
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 = 2
Left = 1080
TabIndex = 5
Top = 2160
Width = 1455
End
Begin VB.OptionButton Option1
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 = 3
Left = 1080
TabIndex = 4
Top = 3600
Width = 1575
End
Begin VB.OptionButton Option1
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 = 4
Left = 1080
TabIndex = 3
Top = 2880
Width = 1575
End
Begin VB.TextBox Text1
BackColor = &H00E0E0E0&
Height = 270
Left = 720
TabIndex = 2
Top = 5280
Width = 1935
End
Begin VB.CommandButton Command2
Caption = "打 印"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2040
Picture = "frmPSHPXX.frx":37B9
Style = 1 'Graphical
TabIndex = 1
Top = 6120
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 = 360
TabIndex = 8
Top = 4440
Width = 2775
End
End
End
Attribute VB_Name = "frmPSHPXX"
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(0).Value = True Then
On Error Resume Next
rs.Close
rs.Open "select * from 货品信息 where 货品编号 like " & "'%" & Text1.Text & "%'", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = rs
End If
If Option1(1).Value = True Then
On Error Resume Next
rs.Close
rs.Open "select * from 货品信息 where 物资号 like " & "'%" & Text1.Text & "%'", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = rs
End If
If Option1(2).Value = True Then
On Error Resume Next
rs.Close
rs.Open "select * from 货品信息 where 合同号 like " & "'%" & Text1.Text & "%'", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = rs
End If
If Option1(4).Value = True Then
On Error Resume Next
rs.Close
rs.Open "select * from 货品信息 where 提货日期 like " & "'%" & Text1.Text & "%'", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = rs
End If
If Option1(3).Value = True Then
On Error Resume Next
rs.Close
rs.Open "select * from 货品信息 where 发货单号 like " & "'%" & Text1.Text & "%'", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = rs
End If
End Sub
Private Sub Command3_Click()
If Text3(0) = "" Then
MsgBox "货品编号不能为空!", vbExclamation, "提示"
ElseIf Text3(1) = "" Then
MsgBox "货品状态不能为空!", vbExclamation, "提示"
ElseIf Text3(5) = "" Then
MsgBox "物资重量不能为空!", vbExclamation, "提示"
ElseIf Text3(7) = "" Then
MsgBox "物资数量不能为空!", vbExclamation, "提示"
ElseIf Text3(4) = "" Then
MsgBox "出货单号不能为空!", vbExclamation, "提示"
End If
'GoTo er
If Option2.Value = False And Option3.Value = False Then
MsgBox "请选择货品质量状况!"
GoTo er
End If
If Option2.Value = True Then
'On Error Resume Next
rs.Close
rs.Open "insert into 货品信息(货品编号,货品状态,物资号,合同号,货品重量,货品件数,出货单号,发货时间,发货人,货品安全等级,质量状况)values('" & Trim(Text3(0).Text) & "','" & Trim(Text3(1).Text) & "','" & Trim(Text3(2).Text) & "','" & Trim(Text3(3).Text) & "','" & Trim(Text3(5).Text) & "','" & Trim(Text3(7).Text) & "','" & Trim(Text3(4).Text) & "','" & DTPicker1.Value & "','" & Trim(Text3(6).Text) & "','" & Trim(Text3(9).Text) & "','" & Option2.Caption & "')", db, adOpenStatic, adLockReadOnly
End If
If Option3.Value = True Then
'On Error Resume Next
rs.Close
rs.Open "insert into 货品信息(货品编号,货品状态,物资号,合同号,货品重量,货品件数,出货单号,发货时间,发货人,货品安全等级,质量状况)values('" & Trim(Text3(0).Text) & "','" & Trim(Text3(1).Text) & "','" & Trim(Text3(2).Text) & "','" & Trim(Text3(3).Text) & "','" & Trim(Text3(5).Text) & "','" & Trim(Text3(7).Text) & "','" & Trim(Text3(4).Text) & "','" & DTPicker1.Value & "','" & Trim(Text3(6).Text) & "','" & Trim(Text3(9).Text) & "','" & Option3.Caption & "')", db, adOpenStatic, adLockReadOnly
End If
Text3(0) = ""
Text3(1) = ""
Text3(2) = ""
Text3(3) = ""
Text3(5) = ""
Text3(7) = ""
Text3(4) = ""
Text3(6) = ""
Text3(9) = ""
Text3(0).SetFocus
er:
End Sub
Private Sub Command4_Click()
rs.Close
rs.Open "select * from 货品信息", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = Adodc1
End Sub
Private Sub Command5_Click()
Unload Me
End Sub
Private Sub Command6_Click()
'rs.Close
rs.Open "delete 货品信息 where 货品编号='" & Trim(Text3(0).Text) & "'", db, adOpenStatic, adLockReadOnly
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
frmPSHPXX.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 + -