【VB开源代码栏目提醒】:文章导读:在新的一年中,各位网友都进入紧张的学习或是工作阶段。网学会员整理了VB开源代码-RMBGDS.frm的相关内容供大家参考,祝大家在新的一年里工作和学习顺利!
VERSION 5.00
Begin VB.Form RMBGDS
Caption = "商品查询报表"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 5775
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 5775
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
Caption = "
查询"
Height = 2895
Left = 100
TabIndex = 0
Top = 120
Width = 5600
Begin VB.CheckBox CH1
Caption = "库存量不足"
Height = 255
Left = 240
TabIndex = 18
Top = 2280
Width = 2535
End
Begin VB.TextBox LB52
Height = 270
Left = 2280
TabIndex = 16
Top = 1800
Width = 975
End
Begin VB.TextBox LB51
Height = 270
Left = 960
TabIndex = 14
Top = 1800
Width = 975
End
Begin VB.TextBox LB42
Height = 270
Left = 2280
TabIndex = 12
Top = 1440
Width = 975
End
Begin VB.TextBox LB41
Height = 270
Left = 960
TabIndex = 10
Top = 1440
Width = 975
End
Begin VB.CommandButton BTN_QUT
Caption = "关闭"
Height = 500
Left = 3840
TabIndex = 9
Top = 1440
Width = 1500
End
Begin VB.TextBox LB31
Height = 270
Left = 960
TabIndex = 5
Top = 1080
Width = 975
End
Begin VB.CommandButton BTN_CLR
Caption = "清除"
Height = 500
Left = 3840
TabIndex = 4
Top = 840
Width = 1500
End
Begin VB.TextBox LB21
Height = 270
Left = 960
TabIndex = 3
Top = 720
Width = 975
End
Begin
VB.TextBox LB11
Height = 270
Left = 960
TabIndex = 2
Top = 360
Width = 975
End
Begin VB.CommandButton BTN_SEA
Caption = "查询"
Height = 500
Left = 3840
TabIndex = 1
Top = 240
Width = 1500
End
Begin VB.Label Label4
Caption = "°"
Height = 195
Left = 2040
TabIndex = 17
Top = 1845
Width = 315
End
Begin VB.Label Label3
Caption = "产品成本"
Height = 195
Left = 120
TabIndex = 15
Top = 1845
Width = 795
End
Begin VB.Label Label2
Caption = "°"
Height = 195
Left = 2040
TabIndex = 13
Top = 1478
Width = 315
End
Begin VB.Label Label1
Caption = "产品售价"
Height = 195
Left = 120
TabIndex = 11
Top = 1485
Width = 795
End
Begin VB.Label Label9
Caption = "产品分类"
Height = 195
Left = 120
TabIndex = 8
Top = 1125
Width = 795
End
Begin VB.Label Label8
Caption = "供应厂商"
Height = 195
Left = 120
TabIndex = 7
Top = 758
Width = 795
End
Begin VB.Label Label7
Caption = "商品条码"
Height = 195
Left = 120
TabIndex = 6
Top = 398
Width = 795
End
End
End
Attribute VB_Name = "RMBGDS"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public CN As New ADODB.Connection, RS As New ADODB.Recordset
Public SQL As String
Const DBPATH = "./POS.MDB"
Const ConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DBPATH
Private Sub BTN_CLR_Click()
LB11.Text = ""
LB21.Text = ""
LB31.Text = ""
LB41.Text = ""
LB42.Text = ""
LB51.Text = ""
LB52.Text = ""
End Sub
Private Sub BTN_QUT_Click()
Unload RMBGDS
End Sub
Private Sub BTN_SEA_Click()
DR_BGDS.Sections("ReportHeader").Controls("LB_TITLE").Caption = RMBGDS.Caption
S = "SELECT * FROM BGDS "
S = S & "WHERE BGENO IS NOT NULL"
If (LB11.Text <> "") Then S = S & " AND BGENO LIKE '%" + LB11.Text + "%' "
If (LB21.Text <> "") Then S = S & " AND BSENO = '" + LB21.Text + "' "
If (LB31.Text <> "") Then S = S & " AND BGKIN = '" + LB31.Text + "' "
If (LB41.Text <> "") And (LB42.Text <> "") Then S = S & " AND ( BGPST >= '" + LB41.Text + "' AND BGPST <='" + LB42.Text + "' ) "
If (LB41.Text <> "") And (LB42.Text = "") Then S = S & " AND BGPST >= '" + LB41.Text + "' "
If (LB41.Text = "") And (LB42.Text <> "") Then S = S & " AND BGPST <= '" + LB42.Text + "' "
If (LB51.Text <> "") And (LB52.Text <> "") Then S = S & " AND ( BGCOS >= '" + LB51.Text + "' AND BGCOS <='" + LB52.Text + "' ) "
If (LB51.Text <> "") And (LB52.Text = "") Then S = S & " AND BGCOS >= '" + LB51.Text + "' "
If (LB51.Text = "") And (LB52.Text <> "") Then S = S & " AND BGCOS <= '" + LB52.Text + "' "
If (CH1.Value = 1) Then S = S & " AND BGQTN <= BGQTS "
RS.Open S, ConnString, , , adCmdText
Set DR_BGDS.DataSource = RS
DR_BGDS.Sections("DETAIL").Controls("TEXT1").DataField = "BGENO"
DR_BGDS.Sections("DETAIL").Controls("TEXT2").DataField = "BGNAM"
DR_BGDS.Sections("DETAIL").Controls("TEXT3").DataField = "BSENO"
DR_BGDS.Sections("DETAIL").Controls("TEXT4").DataField = "BGKIN"
DR_BGDS.Sections("DETAIL").Controls("TEXT5").DataField = "BGPST"
DR_BGDS.Sections("DETAIL").Controls("TEXT6").DataField = "BGCOS"
DR_BGDS.Sections("DETAIL").Controls("TEXT7").DataField = "BGQTS"
DR_BGDS.Sections("DETAIL").Controls("TEXT8").DataField = "BGQTN"
DR_BGDS.Show vbModal
RS.Close
End Sub
Private Sub Form_Load()
Load DR_BGDS
CN.Open ConnString
End Sub
Private Sub Form_Unload(Cancel As Integer)
Unload DR_BGDS
CN.Close
End Sub