📄 frmfphwcheck.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmfphwCheck
BorderStyle = 1 'Fixed Single
Caption = "查询货位"
ClientHeight = 4650
ClientLeft = 45
ClientTop = 330
ClientWidth = 3705
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4650
ScaleWidth = 3705
StartUpPosition = 3 '窗口缺省
Begin MSComctlLib.StatusBar StatusBar1
Align = 2 'Align Bottom
Height = 375
Left = 0
TabIndex = 6
Top = 4275
Width = 3705
_ExtentX = 6535
_ExtentY = 661
_Version = 393216
BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
NumPanels = 1
BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Object.Width = 7056
MinWidth = 7056
EndProperty
EndProperty
End
Begin MSComctlLib.ListView ListView1
Height = 2775
Left = 120
TabIndex = 5
Top = 1440
Width = 3495
_ExtentX = 6165
_ExtentY = 4895
LabelWrap = -1 'True
HideSelection = -1 'True
GridLines = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
NumItems = 0
End
Begin VB.Frame Frame1
Caption = "请选择"
Height = 1215
Left = 120
TabIndex = 0
Top = 120
Width = 3375
Begin VB.CommandButton Command2
Caption = "取 消"
Height = 375
Left = 2280
TabIndex = 4
Top = 720
Width = 855
End
Begin VB.CommandButton Command1
Caption = "查 询"
Height = 375
Left = 2280
TabIndex = 3
Top = 240
Width = 855
End
Begin VB.OptionButton Option2
Caption = "尚未存货的货位"
Height = 255
Left = 240
TabIndex = 2
Top = 720
Width = 1575
End
Begin VB.OptionButton Option1
Caption = "已经存货的货位"
Height = 255
Left = 240
TabIndex = 1
Top = 240
Width = 1695
End
End
End
Attribute VB_Name = "frmfphwCheck"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'查询货位编号的使用情况
'有两种查询方法: 未使用的货位编号 , 已经使用货位编号
'使用与未使用是拿货位表中的货位编号与库存表中的货位编号来对比
Option Explicit
Dim i As Integer
Dim lst As ListItem
Private Sub Command1_Click()
If Option1.Value = True Then
SQL = "select [货位编号] from [库存总表]"
Set rs = TransactSQL(SQL)
If rs.RecordCount = 0 Then '如果库存总表中没有货位编号,则表示所有货位编号均未使用
MsgBox "货位编号尚未使用", vbInformation + vbOKOnly, ginfo
Exit Sub
Else
With ListView1
.ListItems.Clear
.ColumnHeaders.Clear
.ColumnHeaders.Add , , "序号", 1050
.ColumnHeaders.Add , , "货位编号", 2100
.View = lvwReport
.ColumnHeaders(2).Alignment = lvwColumnCenter
End With
With ListView1
Do While Not rs.EOF
For i = 1 To rs.RecordCount
Set lst = ListView1.ListItems.Add(, , i)
lst.SubItems(1) = Trim(rs.Fields(0).Value)
rs.MoveNext
Next
Loop
Set lst = Nothing
End With
StatusBar1.Panels(1) = "已经存货的货位的记录一共有:" & rs.RecordCount & "个"
End If
Else
If Option2.Value = True Then
'显示货位编号
SQL = "select [货位编号] from [货位表] where [货位编号] not in (select [货位编号] from [库存总表]) "
Set rs = TransactSQL(SQL)
If rs.RecordCount = 0 Then '如果货位表中没有货位编号,则表示货位编号已经全部用完
MsgBox "货位编号已经全部用完", vbInformation + vbOKOnly, ginfo
ListView1.ListItems.Clear
StatusBar1.Panels(1) = "尚未存货的货位的记录一共有:0个"
Exit Sub
Else
With ListView1
.ListItems.Clear
.ColumnHeaders.Clear
.ColumnHeaders.Add , , "序号", 1050
.ColumnHeaders.Add , , "货位编号", 2100
.View = lvwReport
.ColumnHeaders(2).Alignment = lvwColumnCenter
End With
With ListView1
Do While Not rs.EOF
For i = 1 To rs.RecordCount
Set lst = ListView1.ListItems.Add(, , i)
lst.SubItems(1) = Trim(rs.Fields(0).Value)
rs.MoveNext
Next
Loop
Set lst = Nothing
End With
StatusBar1.Panels(1) = "尚未存货的货位的记录一共有:" & rs.RecordCount & "个"
End If
End If
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Me.Top = 3000
Me.Left = 3000
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -