📄 frm_hzpkc.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frm_hzpkc
BackColor = &H0080C0FF&
BorderStyle = 3 'Fixed Dialog
Caption = "化妆品库存"
ClientHeight = 4620
ClientLeft = 2760
ClientTop = 3756
ClientWidth = 7284
Icon = "frm_hzpkc.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 4620
ScaleWidth = 7284
ShowInTaskbar = 0 'False
Begin VB.Frame Frame1
BackColor = &H0080C0FF&
Caption = "查询条件:"
Height = 1440
Left = 120
TabIndex = 7
Top = 36
Width = 5676
Begin VB.TextBox Text1
Height = 264
Index = 2
Left = 684
TabIndex = 2
Top = 876
Width = 4812
End
Begin VB.TextBox Text1
Height = 264
Index = 1
Left = 684
TabIndex = 1
Top = 564
Width = 4812
End
Begin VB.TextBox Text1
Height = 264
Index = 0
Left = 684
TabIndex = 0
Top = 252
Width = 4812
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "型号:"
Height = 180
Index = 2
Left = 180
TabIndex = 10
Top = 582
Width = 540
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "类型:"
Height = 180
Index = 1
Left = 180
TabIndex = 9
Top = 876
Width = 540
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "名称:"
Height = 180
Index = 0
Left = 180
TabIndex = 8
Top = 288
Width = 540
End
End
Begin VB.CommandButton Command1
BackColor = &H00C0E0FF&
Cancel = -1 'True
Height = 450
Index = 3
Left = 5922
MaskColor = &H00FFFFFF&
Picture = "frm_hzpkc.frx":000C
Style = 1 'Graphical
TabIndex = 6
Top = 1020
UseMaskColor = -1 'True
Width = 1230
End
Begin VB.CommandButton Command1
BackColor = &H00C0E0FF&
Enabled = 0 'False
Height = 450
Index = 1
Left = 5922
MaskColor = &H00FFFFFF&
Picture = "frm_hzpkc.frx":0FC6
Style = 1 'Graphical
TabIndex = 5
Top = 564
UseMaskColor = -1 'True
Width = 1230
End
Begin VB.CommandButton Command1
BackColor = &H00C0E0FF&
Default = -1 'True
Height = 450
Index = 0
Left = 5922
MaskColor = &H00FFFFFF&
Picture = "frm_hzpkc.frx":3BFC
Style = 1 'Graphical
TabIndex = 4
Top = 108
UseMaskColor = -1 'True
Width = 1230
End
Begin MSComctlLib.ListView ListView1
Height = 2928
Left = 108
TabIndex = 3
Top = 1572
Width = 7044
_ExtentX = 12425
_ExtentY = 5165
View = 3
LabelEdit = 1
LabelWrap = -1 'True
HideSelection = 0 'False
AllowReorder = -1 'True
FullRowSelect = -1 'True
GridLines = -1 'True
HotTracking = -1 'True
HoverSelection = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = 16777215
BorderStyle = 1
Appearance = 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
NumItems = 6
BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Text = "名称"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 1
Text = "型号"
Object.Width = 1764
EndProperty
BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 2
Text = "单位"
Object.Width = 1058
EndProperty
BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 1
SubItemIndex = 3
Text = "单价"
Object.Width = 1764
EndProperty
BeginProperty ColumnHeader(5) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 4
Text = "类型"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(6) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 5
Text = "库存"
Object.Width = 2540
EndProperty
End
End
Attribute VB_Name = "frm_hzpkc"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rec As Recordset
Dim itmx As ListItem
Private Sub OKButton_Click()
End Sub
Private Sub Command1_Click(Index As Integer)
On Error GoTo jgqerr
Select Case Index
Case 0 '查询
sqlstr = "select * from 化妆品表 where 名称 like '*" + Text1(0) + "*' and 型号 like '*" + Text1(1) + "*' and 类型 like '*" + Text1(2) + "*'"
Set rec = db.OpenRecordset(sqlstr)
ListView1.ListItems.Clear
Do While Not rec.EOF
Set itmx = ListView1.ListItems.Add(, , "" & rec.Fields(0))
For i = 1 To rec.Fields.Count - 1
itmx.SubItems(i) = "" & rec.Fields(i)
Next i
rec.MoveNext
Loop
If ListView1.ListItems.Count = 0 Then
Command1(1).Enabled = False
Else
Command1(1).Enabled = True
End If
Case 1 '打印
dytr_main Me, 1, Me.Caption, "化妆品库存表"
Case 3 '退出
Unload Me
End Select
Exit Sub
jgqerr:
MsgBox Err.Description, vbOKOnly + vbCritical, "错误"
End Sub
Private Sub ListView1_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)
ListView1.SortKey = ColumnHeader.Index - 1
yn = MsgBox("将按照『" + ColumnHeader.Text + "』排序" + Chr(13) + "是否按升序排列,按[否]将按降序排列", vbYesNo + vbQuestion, "提示")
If yn = vbNo Then
ListView1.SortOrder = lvwDescending
Else
ListView1.SortOrder = lvwAscending
End If
ListView1.Sorted = True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -