📄 frm_checkstock.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "msflxgrd.ocx"
Begin VB.Form frm_checkStock
Caption = "库存盘点(自动盘盈盘亏)"
ClientHeight = 5475
ClientLeft = 60
ClientTop = 345
ClientWidth = 12165
Icon = "frm_checkStock.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 5475
ScaleWidth = 12165
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton cmdPrt
Caption = "打印"
Height = 360
Left = 10035
TabIndex = 14
Top = 645
Width = 1710
End
Begin VB.CommandButton cmdFind
Caption = "查 询"
Height = 360
Left = 10035
TabIndex = 13
Top = 195
Width = 1710
End
Begin VB.Frame Frame1
Height = 1065
Left = 30
TabIndex = 2
Top = 30
Width = 9555
Begin VB.TextBox txtStandard
Appearance = 0 'Flat
BackColor = &H00FFFFFF&
Height = 285
Left = 6840
TabIndex = 7
Top = 195
Width = 2580
End
Begin VB.TextBox txtType
Appearance = 0 'Flat
BackColor = &H00FFFFFF&
Height = 285
Left = 3120
TabIndex = 6
Top = 195
Width = 2580
End
Begin VB.TextBox txtFullname
Appearance = 0 'Flat
BackColor = &H00FFFFFF&
Height = 285
Left = 1005
TabIndex = 5
Top = 615
Width = 2865
End
Begin VB.TextBox txtProduce
Appearance = 0 'Flat
BackColor = &H00FFFFFF&
Height = 285
Left = 4995
TabIndex = 4
Top = 615
Width = 4425
End
Begin VB.TextBox txtTradecode
Appearance = 0 'Flat
BackColor = &H00FFFFFF&
Height = 285
Left = 1005
TabIndex = 3
Top = 195
Width = 1155
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "商品产地:"
Height = 180
Index = 4
Left = 4020
TabIndex = 12
Top = 660
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "商品规格:"
Height = 180
Index = 3
Left = 5940
TabIndex = 11
Top = 270
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "商品型号:"
Height = 180
Index = 2
Left = 2220
TabIndex = 10
Top = 270
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "商品名称:"
Height = 180
Index = 1
Left = 90
TabIndex = 9
Top = 660
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "商品编号:"
Height = 180
Index = 0
Left = 90
TabIndex = 8
Top = 270
Width = 900
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 345
Left = 9990
Top = 4830
Visible = 0 'False
Width = 1785
_ExtentX = 3149
_ExtentY = 609
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
BackColor = &H00FF8080&
ForeColor = &H0000FFFF&
Height = 225
Left = 2265
TabIndex = 1
Text = "Text1"
Top = 1605
Visible = 0 'False
Width = 915
End
Begin MSFlexGridLib.MSFlexGrid MS1
Height = 4260
Left = 45
TabIndex = 0
Top = 1125
Width = 12105
_ExtentX = 21352
_ExtentY = 7514
_Version = 393216
GridLines = 2
AllowUserResizing= 3
End
End
Attribute VB_Name = "frm_checkStock"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdFind_Click()
MS1.Clear
'ADO控件的RecordSource执行SQL语句
Adodc1.RecordSource = "SELECT tradecode, fullname, type, standard, produce, unit, qty, stockcheck FROM tbS_stock WHERE (tradecode LIKE '%" & txtTradecode & "%') AND (fullname LIKE '%" + txtFullname + "%') AND (type LIKE '%" + txtType + "%') AND (standard LIKE '%" + txtStandard + "%') AND (produce LIKE '%" + txtProduce + "%')"
Adodc1.Refresh
Call MSF1 '调用过程,初始化MSFlexGrid控件
If Adodc1.Recordset.RecordCount > 0 Then
MS1.Rows = Adodc1.Recordset.RecordCount
For i = 1 To Adodc1.Recordset.RecordCount '将控件
MS1.TextMatrix(i, 1) = Adodc1.Recordset.Fields(0)
MS1.TextMatrix(i, 2) = Adodc1.Recordset.Fields(1)
MS1.TextMatrix(i, 3) = Adodc1.Recordset.Fields(2)
MS1.TextMatrix(i, 4) = Adodc1.Recordset.Fields(3)
MS1.TextMatrix(i, 5) = Adodc1.Recordset.Fields(4)
MS1.TextMatrix(i, 6) = Adodc1.Recordset.Fields(5)
MS1.TextMatrix(i, 7) = Adodc1.Recordset.Fields(6)
On Error Resume Next '可以赋值空
MS1.TextMatrix(i, 8) = Adodc1.Recordset.Fields(7)
Adodc1.Recordset.MoveNext '将记录移动到下一条
Next i
'定义MS1表的列序号
For i = 1 To MS1.Rows
MS1.TextMatrix(i, 0) = i
Next i
Else
MsgBox "无此商品"
End If
End Sub
Private Sub cmdPrt_Click()
Dim v1 As Integer
Dim v2 As Double
Dim v3 As Double
Dim v4 As Double
Dim v5 As Double
Dim v6 As Double
Dim v7 As Double
Dim v8 As Double
Dim v9 As Double
Dim X As Double
X = 1
v1 = 100
v2 = MS1.ColWidth(0) * 2 + v1
v3 = v2 + MS1.ColWidth(1) * X
v4 = v3 + MS1.ColWidth(2) * X
v5 = v4 + MS1.ColWidth(6) * X
v6 = v5 + MS1.ColWidth(7) * X
v7 = v6 + MS1.ColWidth(8) * X
v8 = v7 + MS1.ColWidth(9) * X
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -