【VB开源代码栏目提醒】:网学会员鉴于大家对VB开源代码十分关注,论文会员在此为大家搜集整理了“RMPOSAINVOICE.frm”一文,供大家参考学习
VERSION 5.00
Begin VB.Form RMPOSAINVOICE
Caption = "发票记录明细表"
ClientHeight = 2535
ClientLeft = 60
ClientTop = 345
ClientWidth = 5775
LinkTopic = "Form1"
ScaleHeight = 2535
ScaleWidth = 5775
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
Caption = "查询"
Height = 2295
Left = 120
TabIndex = 0
Top = 120
Width = 5600
Begin VB.OptionButton OP3
Caption = "全部"
Height = 255
Left = 240
TabIndex = 12
Top = 1920
Value = -1 'True
Width = 1335
End
Begin VB.OptionButton OP2
Caption = "未开发票"
Height = 255
Left = 240
TabIndex = 11
Top = 1560
Width = 1335
End
Begin VB.OptionButton OP1
Caption = "有开发票"
Height = 255
Left = 240
TabIndex = 10
Top = 1200
Width = 1335
End
Begin VB.CommandButton BTN_SEA1
Caption = "
查询"
Height = 500
Left = 3840
TabIndex = 6
Top = 240
Width = 1500
End
Begin VB.TextBox LB11
Height = 270
Left = 960
TabIndex = 5
Top = 360
Width = 975
End
Begin VB.CommandButton BTN_CLR
Caption = "清除"
Height = 500
Left = 3840
TabIndex = 4
Top = 840
Width = 1500
End
Begin
VB.CommandButton BTN_QUT
Caption = "关闭"
Height = 500
Left = 3840
TabIndex = 3
Top = 1440
Width = 1500
End
Begin VB.TextBox LB21
Height = 270
Left = 960
TabIndex = 2
Top = 720
Width = 975
End
Begin VB.TextBox LB22
Height = 270
Left = 2280
TabIndex = 1
Top = 720
Width = 975
End
Begin VB.Label Label7
Caption = "收银台"
Height = 195
Left = 120
TabIndex = 9
Top = 398
Width = 795
End
Begin VB.Label Label1
Caption = "销售日期"
Height = 195
Left = 120
TabIndex = 8
Top = 765
Width = 795
End
Begin VB.Label Label2
Caption = "°"
Height = 195
Left = 2040
TabIndex = 7
Top = 765
Width = 315
End
End
End
Attribute VB_Name = "RMPOSAINVOICE"
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 RMPOSAINVOICE
End Sub
Private Sub BTN_SEA1_Click()
DR_POSAINVOICE.Sections("ReportHeader").Controls("LB_TITLE").Caption = RMPOSAINVOICE.Caption
S = "SELECT * FROM POSA "
S = S & "WHERE PAENO IS NOT NULL "
If (LB11.Text <> "") Then S = S & " AND POSA.PAIDE = '" + LB11.Text + "' "
If (LB21.Text <> "") And (LB22.Text <> "") Then S = S & " AND ( PSDAT >= #" + LB21.Text + "# AND PSDAT <=#" + LB22.Text + "# ) "
If (LB21.Text <> "") And (LB22.Text = "") Then S = S & " AND PSDAT >= #" + LB21.Text + "# "
If (LB21.Text = "") And (LB22.Text <> "") Then S = S & " AND PSDAT <= #" + LB22.Text + "# "
If (OP1.Value = True) Then S = S & " AND PAIPN = -1 "
If (OP2.Value = True) Then S = S & " AND PAIPN = 0 "
S = S & "ORDER BY PAENO "
RS.Open S, ConnString, , , adCmdText
Set DR_POSAINVOICE.DataSource = RS
DR_POSAINVOICE.Sections("DETAIL").Controls("TEXT1").DataField = "PAENO"
DR_POSAINVOICE.Sections("DETAIL").Controls("TEXT2").DataField = "PAIDE"
DR_POSAINVOICE.Sections("DETAIL").Controls("TEXT3").DataField = "PADAT"
DR_POSAINVOICE.Sections("DETAIL").Controls("TEXT4").DataField = "PAIVO"
DR_POSAINVOICE.Sections("DETAIL").Controls("TEXT5").DataField = "PACOT"
DR_POSAINVOICE.Sections("ReportFooter").Controls("Function1").DataField = "PACNT"
DR_POSAINVOICE.Sections("ReportFooter").Controls("Function2").DataField = "PACOT"
DR_POSAINVOICE.Show vbModal
RS.Close
End Sub
Private Sub Form_Load()
Load DR_POSAINVOICE
CN.Open ConnString
End Sub
Private Sub Form_Unload(Cancel As Integer)
Unload DR_POSAINVOICE
CN.Close
End Sub