📄 main_kcgl_cx.frm
字号:
DataField = "商品编号"
Caption = "商品编号"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = "商品名称"
Caption = "商品名称"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column02
DataField = "拼音码"
Caption = "拼音码"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column03
DataField = "批号"
Caption = "批号"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column04
DataField = "产地"
Caption = "产地"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column05
DataField = "规格"
Caption = "规格"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column06
DataField = "包装"
Caption = "包装"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column07
DataField = "单位"
Caption = "单位"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column08
DataField = "进价"
Caption = "进价"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column09
DataField = "库存"
Caption = "库存"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
ColumnWidth = 854.929
EndProperty
BeginProperty Column01
ColumnWidth = 1184.882
EndProperty
BeginProperty Column02
ColumnWidth = 840.189
EndProperty
BeginProperty Column03
ColumnWidth = 1154.835
EndProperty
BeginProperty Column04
ColumnWidth = 1049.953
EndProperty
BeginProperty Column05
ColumnWidth = 929.764
EndProperty
BeginProperty Column06
ColumnWidth = 734.74
EndProperty
BeginProperty Column07
ColumnWidth = 510.236
EndProperty
BeginProperty Column08
ColumnWidth = 780.095
EndProperty
BeginProperty Column09
ColumnWidth = 884.976
EndProperty
EndProperty
End
End
Attribute VB_Name = "main_kcgl_cx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'*************************************************************************
'**模 块 名:main_kcgl_cx
'**版权说明:吉林省明日科技有限公司享有本软件的所有版权,如果本软件用于商
'** 业用途,必须经过吉林省明日科技有限公司授权。如果提供网上免费
'** 下载,必须经过吉林省明日科技有限公司授权,并保证程序的完整,
'** 不得修改代码、注释和相关内容,否则,我公司将追究其法律责任
'**网 址:www.mingrisoft.com 价值无限,服务无限
'**电 话:(0431)84978981,84978982
'**创 建 人:明日科技
'**日 期:2007-10-31
'**修 改 人:MRLBB
'**日 期:2007-10-31
'**描 述:
'*************************************************************************
Dim fld
Dim rs As New ADODB.Recordset
Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=db_JXC;Data Source=."
Adodc2.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=db_JXC;Data Source=."
Set DataGrid1.DataSource = Adodc1
rs.Open "select * from tb_kc", Cnn, adOpenStatic
Set fld = rs.Fields
For Each fld In rs.Fields
'向combo控件中添加字段
cboFields.AddItem fld.Name
Next
rs.Close
cboFields.RemoveItem (11)
cboFields.RemoveItem (10)
cboFields.ListIndex = 0
'向cboOperator中添加查询条件
cboOperator.AddItem ("like")
cboOperator.AddItem ("=")
cboOperator.AddItem (">")
cboOperator.AddItem (">=")
cboOperator.AddItem ("<")
cboOperator.AddItem ("<=")
cboOperator.AddItem ("<>")
cboOperator.ListIndex = 0
' Dim f1 As StdDataFormat
' Set f1 = DataGrid1.Columns(8).DataFormat
' f1.Format = "¥##0.00"
End Sub
Private Sub cmdFind_Click() '查询
Select Case Adodc1.Recordset(cboFields.ListIndex).Type
Case 202 '字符型
If cboOperator.text <> "like" Then
MsgBox "字符型数据只能选“Like”作为运算符!"
cboOperator.ListIndex = 0
End If
Adodc1.RecordSource = "tb_kc where tb_kc." & cboFields & " like+ '" + txtdata + "'+'%'"
Adodc1.Refresh
Adodc2.RecordSource = "select count(*) as 库存品种,sum(库存)as 库存总数量,sum(进价*库存) as 库存总金额 from tb_kc where tb_kc." & cboFields & " like+ '" + txtdata + "'+'%'"
Adodc2.Refresh
Case 3 '长整型
If IsNumeric(txtdata) = False Then
MsgBox "请输入正确的数据!"
Exit Sub
End If
If cboOperator.text = "like" Then
MsgBox "数值型数据不能选用“Like”作为运算符!"
cboOperator.ListIndex = 2
End If
Adodc1.RecordSource = "tb_kc where tb_kc." & cboFields & cboOperator & txtdata
Adodc1.Refresh
Adodc2.RecordSource = "select count(*) as 库存品种,sum(库存)as 库存总数量,sum(进价*库存) as 库存总金额 from tb_kc where tb_kc." & cboFields & cboOperator & txtdata
Adodc2.Refresh
Case 5 '双精度
If cboOperator.text = "like" Then
MsgBox "数值型数据不能选用“Like”作为运算符!"
cboOperator.ListIndex = 2
End If
If IsNumeric(txtdata) = False Then
MsgBox "请输入正确的数据!"
Exit Sub
End If
Adodc1.RecordSource = "tb_kc where tb_kc." & cboFields & cboOperator & txtdata
Adodc1.Refresh
Adodc2.RecordSource = "select count(*) as 库存品种,sum(库存)as 库存总数量,sum(进价*库存) as 库存总金额 from tb_kc where tb_kc." & cboFields & cboOperator & txtdata
Adodc2.Refresh
End Select
With Adodc2.Recordset
If .RecordCount > 0 Then
If .Fields(0) <> "" Then lblPZ = .Fields(0) Else lblPZ = "0"
If .Fields(1) <> "" Then lblZSL = .Fields(1) Else lblZSL = "0"
If .Fields(2) <> "" Then lblZJE = Format(.Fields(2), "¥##0.00") Else lblZJE = "0.00"
End If
End With
RegInfo Me
End Sub
Private Sub cmdExit_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -