📄 frminputlist.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmInputList
Caption = "物料清单"
ClientHeight = 6225
ClientLeft = 1860
ClientTop = 1575
ClientWidth = 6990
LinkTopic = "Form1"
ScaleHeight = 6225
ScaleWidth = 6990
Begin MSComctlLib.ListView Lview
Height = 5745
Left = 120
TabIndex = 0
Top = 360
Width = 6735
_ExtentX = 11880
_ExtentY = 10134
View = 3
LabelWrap = 0 'False
HideSelection = 0 'False
HideColumnHeaders= -1 'True
FullRowSelect = -1 'True
GridLines = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483624
BorderStyle = 1
Appearance = 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
NumItems = 4
BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Text = "物料编码"
Object.Width = 2470
EndProperty
BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 1
Text = "物料类型"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 2
Text = "计量单位"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 3
Text = "物料名称"
Object.Width = 2540
EndProperty
End
Begin VB.Label Label1
BackColor = &H8000000A&
Caption = "物料编码 物料类型 物料名称 计量单位"
BeginProperty Font
Name = "宋体"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 225
Left = 180
TabIndex = 1
Top = 120
Width = 6585
End
End
Attribute VB_Name = "frmInputList"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'Const ssv = "Select material_no,material_name,(material_sum/material_qty) from material where material_qty<>0"
Const ssv = "Select material_no,material_type,material_name,material_unit from material order by material_no"
Private Sub Form_Load()
Me.Icon = frmain.Icon
Lview.ListItems.Clear
Call LvFill(ssv, frmInputList.Lview)
End Sub
Public Sub LvFill(sscondition As String, LV As ListView)
'ssconditon 为查询的语句,要求:全部字段都必须是填充的字段,且字段值不能为空
'LV 为放置查询结果的 ListView 控件
Dim rs As Recordset
Dim Ritem As ListItem
Dim ir As Integer, ic As Integer
LV.ListItems.Clear
Set rs = New Recordset
rs.Open sscondition, db, adOpenStatic, adLockOptimistic
If rs.RecordCount <> 0 Then
rs.MoveFirst
For ir = 0 To rs.RecordCount - 1
Set Ritem = LV.ListItems.Add(, , Trim(rs(0)))
For ic = 1 To rs.Fields.Count - 1
If IsNull(rs(ic)) Then
Ritem.SubItems(ic) = 1
Else
Ritem.SubItems(ic) = Trim(rs(ic))
End If
Next
rs.MoveNext
Next
End If
rs.Close
End Sub
Private Sub Form_Resize()
'On Error Resume Next
'Top = 0
'Left = 50
End Sub
Private Sub Lview_DblClick()
Dim ss, s1, s2, s3 As String
If Lview.ListItems.Count = 0 Then
Me.Hide
Exit Sub
End If
With Lview.SelectedItem
ss = .Text
s1 = .SubItems(1)
s2 = .SubItems(2)
s3 = .SubItems(3)
End With
Select Case frmInputList.Tag
Case "Input"
With frmInput.Msfg
.TextMatrix(.Row, 0) = ss
.TextMatrix(.Row, 1) = s1
.TextMatrix(.Row, 2) = s2
.TextMatrix(.Row, 4) = s3
End With
End Select
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -