?? 單據(jù)打印類型.frm
字號:
VERSION 5.00
Begin VB.Form XT_BillPrintType
BorderStyle = 1 'Fixed Single
Caption = "打印類型編碼設(shè)置"
ClientHeight = 2940
ClientLeft = 45
ClientTop = 330
ClientWidth = 3630
Icon = "單據(jù)打印類型.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2940
ScaleWidth = 3630
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton Command4
Caption = "取消&C"
Height = 285
Left = 2490
TabIndex = 4
Top = 2550
Width = 975
End
Begin VB.CommandButton Command3
Caption = "刪除&D"
Height = 285
Left = 2490
TabIndex = 3
Top = 1020
Width = 975
End
Begin VB.CommandButton Command2
Caption = "添加&N"
Height = 285
Left = 2520
TabIndex = 2
Top = 120
Width = 975
End
Begin VB.CommandButton Command1
Caption = "修改&E"
Height = 285
Left = 2490
TabIndex = 1
Top = 570
Width = 975
End
Begin VB.ListBox List1
Height = 2760
Left = 60
TabIndex = 0
Top = 90
Width = 2295
End
End
Attribute VB_Name = "XT_BillPrintType"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Ssql As String
Private Sub Command1_Click()
On Error GoTo err_exit
If XT_BillDesign.WglrGrid.Visible = False Then MsgBox "此種單據(jù)類型不能修改類型! ", 16: Exit Sub
Dim valueStr As String
Dim aDo_re As New Recordset
If Trim(List1.Text) = "" Then MsgBox "請選定一個編碼! ", 48: Exit Sub
valueStr = InputBox("編碼名稱", "打印類型編碼設(shè)置---修改", Trim(List1.Text))
If Trim(valueStr) = "" Then Exit Sub
Set aDo_re = Cw_DataEnvi.DataConnect.Execute("select * from Xt_BillGridPrint where PrintGridCode='" & Trim(valueStr) & "' AND PrintGridCode<>'" & Trim(List1.Text) & "' and grid_code='" & Trim(Me.Tag) & "'")
If aDo_re.RecordCount > 0 Then MsgBox "編碼不能重復(fù)! ", 48: Exit Sub
aDo_re.Close
Set aDo_re = Cw_DataEnvi.DataConnect.Execute("select * from xt_BillDesign where Billname='" & Trim(XT_BillDesign.ComboName.Tag) & "'")
Ssql = "UPDATE Xt_BillGridPrint SET PrintGridCode='" & valueStr & "' WHERE PrintGridCode='" & Trim(List1.Text) & "' and grid_code='" & Trim(aDo_re!Grid_code) & "'"
Cw_DataEnvi.DataConnect.Execute Ssql
Ssql = "UPDATE Xt_BilltextPrint SET PrinttextCode='" & valueStr & "' WHERE PrinttextCode='" & Trim(List1.Text) & "' and text_group_code='" & Trim(aDo_re!Grid_code) & "'"
Cw_DataEnvi.DataConnect.Execute Ssql
Form_Activate
Exit Sub
err_exit:
MsgBox Err.Description, 16
End Sub
Private Sub Command2_Click()
On Error GoTo err_exit
If XT_BillDesign.WglrGrid.Visible = False Then MsgBox "此種單據(jù)類型不能添加類型! ", 16: Exit Sub
Dim valueStr As String
Dim aDo_re As New Recordset
valueStr = InputBox("編碼名稱", "打印類型編碼設(shè)置---添加", "")
If Trim(valueStr) = "" Then Exit Sub
Set aDo_re = Cw_DataEnvi.DataConnect.Execute("select * from Xt_BillGridPrint where PrintGridCode='" & Trim(valueStr) & "' and grid_code='" & Trim(Me.Tag) & "'")
If aDo_re.RecordCount > 0 Then MsgBox "編碼不能重復(fù)! ", 48: Exit Sub
aDo_re.Close
Set aDo_re = Cw_DataEnvi.DataConnect.Execute("select * from xt_BillDesign where Billname='" & Trim(XT_BillDesign.ComboName.Tag) & "'")
Ssql = "insert into Xt_BillGridPrint(Grid_Code,ColIndex,PrintGridCode,PrintGridHeight,PrintGridWidth,PrintGridTop,PrintGridLeft,PrintDataRows,PrintColWidth,BillTitlePrint)" _
& " select Grid_Code,ColIndex,PrintGridCode='" & Trim(valueStr) & "',PrintGridHeight=GridHeight,PrintGridWidth=GridWidth,PrintGridTop=GridTop," _
& "PrintGridLeft=GridLeft,PrintDataRows=3,PrintColWidth=ColWidth,BillTitlePrint='" & XT_BillDesign.Lab_Title.Caption & "' from xt_grid where grid_code='" & Trim(aDo_re!Grid_code) & "'"
Cw_DataEnvi.DataConnect.Execute Ssql
Ssql = "insert into Xt_BilltextPrint(text_group_code,text_index,PrintTextCode,PrintTop,PrintLeft,Printwidth) " _
& " select text_group_code,text_index,PrintTextCode='" & Trim(valueStr) & "', PrintTop=texttop,PrintLeft=textleft,Printwidth=textwidth from Xt_text_input" _
& " where text_group_code='" & Trim(aDo_re!text_group_code) & "'"
Cw_DataEnvi.DataConnect.Execute Ssql
Form_Activate
Exit Sub
err_exit:
MsgBox Err.Description, 16
End Sub
Private Sub Command3_Click()
On Error GoTo err_exit
Dim aDo_re As New Recordset
Set aDo_re = Cw_DataEnvi.DataConnect.Execute("select * from xt_BillDesign where Billname='" & Trim(XT_BillDesign.ComboName.Tag) & "'")
If XT_BillDesign.WglrGrid.Visible = True Then
Ssql = "delete Xt_BillGridPrint WHERE PrintGridCode='" & Trim(List1.Text) & "' and grid_code='" & Trim(aDo_re!Grid_code) & "'"
Cw_DataEnvi.DataConnect.Execute Ssql
End If
Ssql = "delete Xt_BilltextPrint WHERE PrinttextCode='" & Trim(List1.Text) & "' and text_group_code='" & Trim(aDo_re!text_group_code) & "'"
Cw_DataEnvi.DataConnect.Execute Ssql
Form_Activate
Exit Sub
err_exit:
MsgBox Err.Description, 16
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub Form_Activate()
Dim aDo_Printtype As New Recordset
List1.Clear
Dim aDo_re As New Recordset
Set aDo_re = Cw_DataEnvi.DataConnect.Execute("select * from xt_BillDesign where Billname='" & Trim(XT_BillDesign.ComboName.Tag) & "'")
If XT_BillDesign.WglrGrid.Visible = True Then
Ssql = "select * from Xt_BillGridPrint where colindex='000' and grid_code='" & Trim(aDo_re!Grid_code) & "'"
Set aDo_Printtype = Cw_DataEnvi.DataConnect.Execute(Ssql)
Do While Not aDo_Printtype.EOF
List1.AddItem aDo_Printtype!printgridcode
aDo_Printtype.MoveNext
Loop
Else: Ssql = "select * from Xt_BillTextPrint where text_group_code='" & Trim(aDo_re!text_group_code) & "'"
Set aDo_Printtype = Cw_DataEnvi.DataConnect.Execute(Ssql)
If aDo_Printtype.RecordCount < 1 Then Exit Sub
List1.AddItem "Default"
End If
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -