资源名称:ERPSYS.zip [点击查看]
上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:59k
源码类别:
企业管理
开发平台:
Visual Basic
- VERSION 5.00
- Object = "{BEEECC20-4D5F-4F8B-BFDC-5D9B6FBDE09D}#1.0#0"; "vsflex8.ocx"
- Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
- Begin VB.Form AutoTran_DefiSy
- BackColor = &H00E9F4FA&
- BorderStyle = 1 'Fixed Single
- Caption = "期间损益转帐凭证"
- ClientHeight = 7230
- ClientLeft = 675
- ClientTop = 720
- ClientWidth = 10530
- Icon = "自动转帐凭证_期间损益转帐定义.frx":0000
- KeyPreview = -1 'True
- LinkTopic = "Form4"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 7230
- ScaleWidth = 10530
- Begin VB.PictureBox Pic_Title
- Height = 1410
- Left = 0
- Picture = "自动转帐凭证_期间损益转帐定义.frx":1042
- ScaleHeight = 1350
- ScaleWidth = 11835
- TabIndex = 10
- Top = 570
- Width = 11895
- Begin VB.CommandButton Ydcommand1
- Height = 297
- Left = 3360
- Picture = "自动转帐凭证_期间损益转帐定义.frx":35106
- Style = 1 'Graphical
- TabIndex = 23
- Top = 720
- Visible = 0 'False
- Width = 283
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 0
- Left = 4710
- TabIndex = 1
- Text = "0"
- Top = 690
- Width = 1693
- End
- Begin VB.ComboBox CmbOut_In
- Height = 300
- Left = 7380
- TabIndex = 3
- Text = "Combo1"
- Top = 690
- Width = 1365
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 2
- Left = 7380
- TabIndex = 4
- Text = "2"
- Top = 1050
- Width = 2535
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 1
- Left = 4710
- TabIndex = 2
- Text = "1"
- Top = 1050
- Width = 1693
- End
- Begin VB.Label tsLabel
- AutoSize = -1 'True
- BackColor = &H80000018&
- BackStyle = 0 'Transparent
- Caption = "期间损益转帐凭证"
- BeginProperty Font
- Name = "宋体"
- Size = 12
- Charset = 134
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H00000000&
- Height = 240
- Index = 0
- Left = 570
- TabIndex = 21
- Top = 240
- Width = 2040
- End
- Begin VB.Label Lbl_AutoAccClassCode
- Caption = "Lbl_AutoAccClassCode"
- Height = 240
- Left = 1695
- TabIndex = 20
- Top = 90
- Visible = 0 'False
- Width = 1980
- End
- Begin VB.Label Lbl_AutoAccClassName
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "Lbl_AutoAccClassName"
- Height = 240
- Left = 1350
- TabIndex = 19
- Top = 780
- Width = 1830
- End
- Begin VB.Label Lbl_AutoAccCode
- Caption = "Lbl_AutoAccCode"
- Height = 240
- Left = 180
- TabIndex = 18
- Top = 90
- Visible = 0 'False
- Width = 1380
- End
- Begin VB.Label Lbl_AutoAccName
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "Lbl_AutoAccName"
- Height = 240
- Left = 1350
- TabIndex = 17
- Top = 1110
- Width = 1575
- End
- Begin VB.Label tsLabel
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "转帐名称:"
- Height = 180
- Index = 2
- Left = 450
- TabIndex = 16
- Top = 1110
- Width = 810
- End
- Begin VB.Label tsLabel
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "凭证类别:"
- Height = 180
- Index = 1
- Left = 450
- TabIndex = 15
- Top = 780
- Width = 810
- End
- Begin VB.Label Label4
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "收支:"
- Height = 180
- Left = 6840
- TabIndex = 14
- Top = 780
- Width = 450
- End
- Begin VB.Label Label3
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "摘要:"
- Height = 180
- Left = 6840
- TabIndex = 13
- Top = 1110
- Width = 450
- End
- Begin VB.Label Label2
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "本年利润科目:"
- Height = 180
- Left = 3420
- TabIndex = 12
- Top = 1110
- Width = 1170
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "损益科目:"
- Height = 180
- Left = 3780
- TabIndex = 11
- Top = 780
- Width = 810
- End
- End
- Begin VSFlex8Ctl.VSFlexGrid WglrGrid
- Height = 5250
- Left = 0
- TabIndex = 5
- Top = 1950
- Width = 10530
- _cx = 5080
- _cy = 5080
- Appearance = 1
- BorderStyle = 1
- Enabled = -1 'True
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "宋体"
- Size = 9
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- MousePointer = 0
- BackColor = -2147483643
- ForeColor = -2147483640
- BackColorFixed = -2147483633
- ForeColorFixed = -2147483630
- BackColorSel = -2147483635
- ForeColorSel = -2147483634
- BackColorBkg = -2147483632
- BackColorAlternate= -2147483643
- GridColor = -2147483633
- GridColorFixed = -2147483632
- TreeColor = -2147483632
- FloodColor = 192
- SheetBorder = -2147483642
- FocusRect = 1
- HighLight = 1
- AllowSelection = -1 'True
- AllowBigSelection= -1 'True
- AllowUserResizing= 0
- SelectionMode = 0
- GridLines = 1
- GridLinesFixed = 2
- GridLineWidth = 1
- Rows = 5000
- Cols = 10
- FixedRows = 1
- FixedCols = 0
- RowHeightMin = 0
- RowHeightMax = 0
- ColWidthMin = 0
- ColWidthMax = 0
- ExtendLastCol = 0 'False
- FormatString = ""
- ScrollTrack = 0 'False
- ScrollBars = 3
- ScrollTips = 0 'False
- MergeCells = 0
- MergeCompare = 0
- AutoResize = -1 'True
- AutoSizeMode = 0
- AutoSearch = 0
- AutoSearchDelay = 2
- MultiTotals = -1 'True
- SubtotalPosition= 1
- OutlineBar = 0
- OutlineCol = 0
- Ellipsis = 0
- ExplorerBar = 0
- PicturesOver = 0 'False
- FillStyle = 0
- RightToLeft = 0 'False
- PictureType = 0
- TabBehavior = 0
- OwnerDraw = 0
- Editable = 0
- ShowComboButton = 1
- WordWrap = 0 'False
- TextStyle = 0
- TextStyleFixed = 0
- OleDragMode = 0
- OleDropMode = 0
- DataMode = 0
- VirtualData = -1 'True
- DataMember = ""
- ComboSearch = 3
- AutoSizeMouse = -1 'True
- FrozenRows = 0
- FrozenCols = 0
- AllowUserFreezing= 0
- BackColorFrozen = 0
- ForeColorFrozen = 0
- WallPaperAlignment= 9
- AccessibleName = ""
- AccessibleDescription= ""
- AccessibleValue = ""
- AccessibleRole = 24
- End
- Begin VB.Timer Timer1
- Interval = 1
- Left = 0
- Top = 960
- End
- Begin MSComctlLib.Toolbar Tlb_Action
- Align = 1 'Align Top
- Height = 555
- Left = 0
- TabIndex = 6
- Top = 0
- Width = 10530
- _ExtentX = 18574
- _ExtentY = 979
- ButtonWidth = 820
- ButtonHeight = 926
- AllowCustomize = 0 'False
- Wrappable = 0 'False
- Appearance = 1
- Style = 1
- ImageList = "ImageList1"
- _Version = 393216
- BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
- NumButtons = 13
- BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "设置"
- Key = "ymsz"
- Object.ToolTipText = "打印页面设置"
- ImageKey = "sz"
- EndProperty
- BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "打印"
- Key = "dy"
- Object.ToolTipText = "打印当前单据或Ctrl+P"
- ImageKey = "dy"
- EndProperty
- BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "预览"
- Key = "yl"
- ImageKey = "yl"
- EndProperty
- BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "编辑"
- Key = "xg"
- Object.ToolTipText = "修改当前单据或F3"
- ImageKey = "xg"
- EndProperty
- BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Key = "fgh0"
- Style = 3
- EndProperty
- BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "自动"
- Key = "Fill"
- ImageKey = "zd"
- EndProperty
- BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "保存"
- Key = "bc"
- Object.ToolTipText = "保存单据或F6"
- ImageKey = "bc"
- EndProperty
- BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "放弃"
- Key = "fq"
- Object.ToolTipText = "放弃此次操作"
- ImageKey = "fq"
- EndProperty
- BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Key = "fgh2"
- Style = 3
- EndProperty
- BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "帮助"
- Key = "bz"
- ImageKey = "bz"
- EndProperty
- BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "退出"
- Key = "fh"
- ImageKey = "tc"
- EndProperty
- EndProperty
- BorderStyle = 1
- Begin MSComctlLib.Toolbar GsToolbar
- Height = 525
- Left = 8820
- TabIndex = 7
- Top = 0
- Width = 1695
- _ExtentX = 2990
- _ExtentY = 926
- ButtonWidth = 1455
- ButtonHeight = 926
- AllowCustomize = 0 'False
- Appearance = 1
- Style = 1
- ImageList = "ImageList1"
- _Version = 393216
- BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
- NumButtons = 2
- BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "保存格式"
- Key = "bcgs"
- ImageKey = "bcgs"
- EndProperty
- BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "默认列宽"
- Key = "hfmrgs"
- ImageKey = "mrlk"
- EndProperty
- EndProperty
- End
- End
- Begin MSComctlLib.ImageList ImageList1
- Left = 0
- Top = 1200
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 16
- ImageHeight = 16
- MaskColor = 12632256
- _Version = 393216
- BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
- NumListImages = 38
- BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":35490
- Key = "sz"
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":3582A
- Key = "dy"
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":35BC4
- Key = "yl"
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":35F5E
- Key = "xg"
- EndProperty
- BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":362F8
- Key = "zh"
- EndProperty
- BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":36692
- Key = "sh"
- EndProperty
- BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":36A2C
- Key = "bc"
- EndProperty
- BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":36DC6
- Key = "fq"
- EndProperty
- BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":37160
- Key = "bz"
- EndProperty
- BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":374FA
- Key = "tc"
- EndProperty
- BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":37894
- Key = "bcgs"
- EndProperty
- BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":37C2E
- Key = "mrlk"
- EndProperty
- BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":37FC8
- Key = "xsxm"
- EndProperty
- BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":38362
- Key = "first"
- EndProperty
- BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":386FC
- Key = "prev"
- EndProperty
- BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":38A96
- Key = "next"
- EndProperty
- BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":38E30
- Key = "last"
- EndProperty
- BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":391CA
- Key = "xx"
- EndProperty
- BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":39564
- Key = "define"
- EndProperty
- BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":398FE
- Key = "exec"
- EndProperty
- BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":39C98
- Key = "xz"
- EndProperty
- BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":3A032
- Key = "sc"
- EndProperty
- BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":3A3CC
- Key = "sx"
- EndProperty
- BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":3A766
- Key = "cx"
- EndProperty
- BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":3AB00
- Key = "zd"
- EndProperty
- BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":3AE9A
- Key = "dz"
- EndProperty
- BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":3B234
- Key = "ph"
- EndProperty
- BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":3B5CE
- Key = "fz"
- EndProperty
- BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":3B968
- Key = "dw"
- EndProperty
- BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":3BD02
- Key = "hf"
- EndProperty
- BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":3C09C
- Key = "pz"
- EndProperty
- BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":3C436
- Key = "check"
- EndProperty
- BeginProperty ListImage33 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":3C7D0
- Key = "qs"
- EndProperty
- BeginProperty ListImage34 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":3CB6A
- Key = "fullcheck"
- EndProperty
- BeginProperty ListImage35 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":3CF04
- Key = "qq"
- EndProperty
- BeginProperty ListImage36 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":3D29E
- Key = "bcw"
- EndProperty
- BeginProperty ListImage37 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":3D638
- Key = "ye"
- EndProperty
- BeginProperty ListImage38 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "自动转帐凭证_期间损益转帐定义.frx":3D9D2
- Key = ""
- EndProperty
- EndProperty
- End
- Begin VB.Label Lab_OperStatus
- BackColor = &H000080FF&
- Caption = "1"
- Height = 360
- Left = 0
- TabIndex = 22
- Top = 0
- Visible = 0 'False
- Width = 375
- End
- Begin VB.Label Lab_GetName
- Caption = "Lab_GetName"
- Height = 255
- Left = 7320
- TabIndex = 9
- Top = 780
- Visible = 0 'False
- Width = 1065
- End
- Begin VB.Label Lab_Pzclzt
- BackColor = &H0000FFFF&
- Caption = "2"
- ForeColor = &H00808080&
- Height = 330
- Left = 1140
- TabIndex = 8
- Top = 870
- Visible = 0 'False
- Width = 405
- End
- Begin VB.Label tsLabel
- AutoSize = -1 'True
- BackColor = &H80000018&
- BackStyle = 0 'Transparent
- Caption = "期间损益结转"
- BeginProperty Font
- Name = "楷体_GB2312"
- Size = 15.75
- Charset = 134
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H00000000&
- Height = 315
- Index = 6
- Left = 4095
- TabIndex = 0
- Top = 765
- Width = 2085
- End
- Begin VB.Line Line1
- BorderColor = &H000000FF&
- Index = 0
- X1 = 3765
- X2 = 6416
- Y1 = 1110
- Y2 = 1110
- End
- Begin VB.Line Line1
- BorderColor = &H000000FF&
- Index = 1
- X1 = 3765
- X2 = 6416
- Y1 = 1140
- Y2 = 1140
- End
- End
- Attribute VB_Name = "AutoTran_DefiSy"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '*********************************************************************************************************
- '* 模 块 名 称 :期间损益转帐凭证编辑
- '* 功 能 描 述 :此功能模块主要完成期间损益转帐凭证的定义、修改、预览打印等。
- '* 程序员姓名 : 姜冬梅
- '* 最后修改人 : 姜冬梅
- '* 开始设计时间:2001/1/10
- '* 最后修改时间:
- '* 备 注:程序中所有依实际情况自定义部分均用[>> <<]括起
- '*
- '* 1.每次调入外部功能窗体,均要加锁ChangeLock=True,窗体关闭后解锁ChangeLock=false
- '*
- '* 2.网格列存储内容注解
- '*
- '* 3.Lab_OperStatus 用此标签来标识单据录入状态(默认值为1) "1"-浏览 "2"-新增 "3"-修改
- '*
- '* 4.Lab_Pzclzt 用此标签来标识凭证处理状态(默认值为1) "1"-填制凭证 "2"-查询凭证列表 "3"-审核凭证
- '*
- '* 5.原则:只要单据能够存盘(无论修改或新增)则其必须接受完整性及有效性规则检查
- '* 6.期间损益科目的结转全部结转到本年利润
- '*********************************************************************************************************
- '[以下为根据实际情况设置变量
- Dim Jsqte As Long '临时计数器
- Dim Sqlstr As String '临时的SQL字符串
- Dim RecTemp As New ADODB.Recordset '临时使用动态集
- Dim Rec_AutoAccItem As New ADODB.Recordset '转帐项目记录集
- Dim TranClassCode As String '转帐类别编码
- ']
- '以下为固定使用变量(网格)
- Dim Cxnrrec As New ADODB.Recordset '显示查询内容动态集
- Dim Dyymctbl As New DY_Dyymsz '打印页面窗体变量
- Dim GridCode As String '显示网格网格代码
- Dim GridInf() As Variant '整个网格设置信息
- Dim ReportTitle As String '报表主标题
- Dim Tsxx As String '系统提示信息
- Dim Pmbcsjhs As Long '屏幕网格保持数据行数(大于等于1)
- Dim Fzxwghs As Integer '辅助项网格行数(包括合计行)
- Dim Sfxshjwg As Boolean '是否显示合计网格
- Dim Qslz As Long '网格隐藏(非操作显示)列数
- Dim Sjhgd As Double '网格数据行高度
- Dim GridBoolean() As Boolean '网格列信息(布尔型)
- Dim GridStr() As String '网格列信息(字符型)
- Dim GridInt() As Integer '网格列信息(整型)
- Dim Sfblbzkd As Boolean '是否保留帮助宽度(字段提供帮助时,是否为按钮保留空间)
- Dim changelock As Boolean '网格行列改变控制锁(用来区别用户改变.程序改变)
- Dim Valilock As Boolean '文本框失去焦点是否进行有效性控制(TRUE 为锁定*限用网格录入)
- Dim Szzls As Integer '网格信息数组最大下标值(网格列数-1)
- '以下为固定使用变量(文本框)
- Dim Textvar() As Variant '存储变体型文本框信息
- Dim Textboolean() As Boolean '存储布尔型文本框信息
- Dim Textint() As Integer '存储整型文本框信息
- Dim Textstr() As String '存储字符型文本框信息
- Dim Max_Text_Index As Integer '最大录入文本框索引值
- Dim TextGroupCode As String '文本框录入分组编码
- Dim TextValiLock As Boolean '文本框失去焦点是否进行有效性控制判断
- Dim TextValiJudgeLock() As Boolean '文本框录入有效性判断控制锁,=True时光标离开不需要马上进行判断
- '=False时,即允许马上进行有效性验证。
- Dim CurTextIndex As Integer '当前文本框索引值
- Dim TextChangeLock As Boolean '文本框内容变换控制锁.=True时屏蔽LrText.Change事件,=False时则执行。
- '=True时,关闭Change事件,当新增记录填充网格、取消操作、按帮助按纽时均需关闭CHANGE事件。
- Dim Bln_Cancel As Boolean '取消按钮信息传递
- Private Sub Form_KeyPress(KeyAscii As Integer) '控 制 焦 点 转 移
- Dim jdzygs As Integer
- jdzygs = 10
- Select Case KeyAscii
- Case vbKeyReturn
- If Kjjdzy(jdzygs) Then
- KeyAscii = 0
- End If
- Case 39 '屏蔽字符"'"
- KeyAscii = 0
- End Select
- End Sub
- Private Sub Form_Load() '窗 体 装 入
- TranClassCode = AutoTran_TranList.TranClassCode
- '报表主标题及报表编码
- ReportTitle = "期间损益结转"
- XtReportCode = "Cwzz_AutoAccDefiMy"
- Load Dyymctbl
- '调 入 网 格
- GridCode = "Cwzz_AutoAccDefiSy " '网格属性编码"
- Call BzWgcsh(WglrGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
- Qslz = GridInf(1)
- Sjhgd = GridInf(2)
- Pmbcsjhs = GridInf(3)
- Fzxwghs = GridInf(4)
- Sfblbzkd = GridInf(5)
- Shsfts = GridInf(6)
- Sfxshjwg = GridInf(7)
- Szzls = WglrGrid.Cols - 1
- For Jsqte = WglrGrid.FixedRows To WglrGrid.Rows - 1
- WglrGrid.RowHeight(Jsqte) = Sjhgd
- Next Jsqte
- '填充收支方向
- Call FillCombo(CmbOut_In, "Cwzz_OutIn", "", 0)
- '调入文本框
- TextGroupCode = "Cwzz_AutoAccDefiSy"
- Call Drwbkxx(TextGroupCode, Textvar(), Textboolean(), Textint(), Textstr()) '读入文本框录入信息
- Call Wbkcsh
- Call Cxnrtcwg
- '装入会计科目编码帮助窗体(为加快参照速度)PZ_FrmKjkmcz
- Load PZ_FrmKjkmcz
- Lab_OperStatus = 3
- End Sub
- Private Sub Cxnrtcwg() '查 询 内 容 填 充 网 格
- '读入凭证类别,转帐名称
- With AutoTran_TranList.CzxsGrid
- Lbl_AutoAccCode.Caption = .Tag
- End With
- Sqlstr = "SELECT Cwzz_AutoTranMain.VouchClassCode, Cwzz_VouchClass.VouchClassName, " & _
- " Cwzz_AutoTranMain.TranName , Cwzz_AutoTranMain.TranCode FROM Cwzz_AutoTranMain " & _
- "left OUTER JOIN Cwzz_VouchClass ON " & _
- "Cwzz_VouchClass.VouchClassCode = Cwzz_AutoTranMain.VouchClassCode where TranCode='" & Lbl_AutoAccCode.Caption & "' and TranClass='" & TranClassCode & "'"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- Lbl_AutoAccName.Caption = Trim(RecTemp.Fields("TranName"))
- Lbl_AutoAccClassCode.Caption = Trim(RecTemp.Fields("VouchClassCode"))
- Lbl_AutoAccClassName.Caption = Trim(RecTemp.Fields("VouchClassName"))
- RecTemp.Close
- '设置操作状态为浏览
- Lab_OperStatus.Caption = "1"
- '设置工具条状态
- Call Sub_OperStatus("11")
- '显示整张单据信息
- Call Sub_ShowBill
- '修改]
- End Sub
- Private Sub Wbkcsh() '录入文本框初始化
- '最大录入文本框索引值
- Max_Text_Index = Textvar(1)
- ReDim TextValiJudgeLock(Max_Text_Index)
- For Jsqte = 0 To Max_Text_Index
- If Len(Trim(Textstr(Jsqte, 1))) <> 0 Then
- TextChangeLock = True
- LrText(Jsqte).Text = ""
- LrText(Jsqte).Tag = ""
- If Textint(Jsqte, 5) <> 0 Then
- LrText(Jsqte).MaxLength = Textint(Jsqte, 5)
- End If
- TextChangeLock = False
- End If
- TextValiJudgeLock(Jsqte) = True
- Next Jsqte
- End Sub
- Private Sub Form_Unload(Cancel As Integer) '窗体卸载
- '卸载打印页面窗体
- Unload Dyymctbl
- '卸载会计科目编码参照窗体
- PZ_FrmKjkmcz.UnloadCheck.Value = 1
- Unload PZ_FrmKjkmcz
- Set Rec_AutoAccItem = Nothing
- Set RecTemp = Nothing
- End Sub
- Private Sub Sub_ShowBill() '根据当前单据号显示整张单据内容
- With WglrGrid
- .Rows = Pmbcsjhs + .FixedRows + Fzxwghs + 1
- For Jsqte = .FixedRows To .Rows - 1
- .RowHeight(Jsqte) = Sjhgd
- Next Jsqte
- End With
- Sqlstr = "SELECT Cwzz_AutoTranItem.TranClass, Cwzz_AutoTranItem.TranCode, " & _
- "Cwzz_AutoTranItem.Ccode, Cwzz_AutoTranItem.GetCcode," & _
- "Cwzz_AccCode1.Cname AS GetName, Cwzz_AccCode.Cname as Cname," & _
- "Cwzz_AutoTranItem.Digest, Cwzz_AutoTranItem.TranOri," & _
- "Cwzz_AutoTranItem.TranProp FROM Cwzz_AccCode Cwzz_AccCode1 RIGHT OUTER JOIN " & _
- "Cwzz_AutoTranItem ON Cwzz_AccCode1.Ccode = Cwzz_AutoTranItem.GetCcode LEFT OUTER JOIN " & _
- "Cwzz_AccCode ON Cwzz_AutoTranItem.Ccode = Cwzz_AccCode.Ccode LEFT OUTER JOIN " & _
- "Cwzz_AutoTranMain ON Cwzz_AutoTranItem.TranCode = Cwzz_AutoTranMain.TranCode AND " & _
- "Cwzz_AutoTranItem.TranClass = Cwzz_AutoTranMain.TranClass " & _
- "where Cwzz_AutoTranItem.TranCode='" & Lbl_AutoAccCode.Caption & "'" & _
- "and Cwzz_AutoTranItem.tranclass='" & TranClassCode & "' and Cwzz_AutoTranItem.FormulaCode<>'05'" & _
- " order by AutoTranId"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- With RecTemp
- WglrGrid.Clear 1
- If .EOF Then
- Exit Sub
- End If
- '[>>显示单据头
- Call Bill_Head_Show
- Jsqte = WglrGrid.FixedRows
- Do While Not .EOF
- If Jsqte >= WglrGrid.Rows Then
- WglrGrid.AddItem ""
- End If
- '[>>显示单据分录
- WglrGrid.TextMatrix(Jsqte, 0) = "*"
- WglrGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = Trim(.Fields("Digest") & "") '摘 要
- WglrGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("Ccode")) '转帐科目编码
- WglrGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = Trim(.Fields("Cname") & "") '科目名称
- WglrGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = Trim(.Fields("TranOri") & "") '转帐性质
- WglrGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = Trim(LrText(1).Text) '利润科目
- WglrGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = Trim(Lab_GetName.Caption) '科目名称
- '<<]
- WglrGrid.RowHeight(Jsqte) = Sjhgd
- .MoveNext
- Jsqte = Jsqte + 1
- Loop
- End With
- End Sub
- Private Sub Tlb_Action_ButtonClick(ByVal Button As MSComctlLib.Button) '用户点击工具条
- '屏蔽文本框,下拉组合框有效性判断,即在网格单元内录入数据时,点帮助信息等,不执行文本框等验证,即不执行YdText或YdCombo的LostFocus事件.
- Valilock = True
- '屏蔽网格失去焦点产生的有效性判断
- changelock = True
- Select Case Button.Key
- Case "ymsz" '页面设置
- Dyymctbl.Show 1
- Case "yl" '预 览
- Call bbyl(True)
- Case "dy" '打 印
- Call bbyl(False)
- Case "xg" '修 改
- Call Sub_EditBill
- Case "Fill" '填充关系
- Call Fill_Relation
- Case "bc" '保 存
- Call Sub_SaveBill
- Case "fq" '放 弃
- Call Sub_AbandonBill
- Case "bz" '帮 助
- Call F1bz
- Case "fh" '退 出
- Unload Me
- End Select
- '解 锁
- Valilock = False
- changelock = False
- End Sub
- Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer) '支持热键操作,更确切地讲,是工具栏热键
- If Shift = 2 Then 'Ctrl的位屏蔽值=2
- Select Case UCase(Chr(KeyCode))
- Case "P" 'Ctrl+P 打印
- If Tlb_Action.Buttons("dy").Enabled Then Call bbyl(False)
- End Select
- End If
- Select Case KeyCode
- Case vbKeyF3 '修改
- If Tlb_Action.Buttons("xg").Enabled Then
- Call Sub_EditBill
- End If
- Case vbKeyF6 '保存凭证
- If Tlb_Action.Buttons("bc").Enabled Then
- Call Sub_SaveBill
- End If
- End Select
- End Sub
- Private Sub Sub_OperStatus(Str_Status As String) '工具条依据不同状态所进行的变化
- With Tlb_Action
- Select Case Str_Status
- Case "10" '浏览(系统进入、放弃新增单据、填制凭证时删除单据,凭证审核)
- '工具条
- .Buttons("dy").Enabled = True '打印
- .Buttons("yl").Enabled = True '预览
- .Buttons("xg").Enabled = False '修改
- .Buttons("Fill").Enabled = False '填充
- .Buttons("zh").Enabled = False '增行
- .Buttons("sh").Enabled = False '删行
- .Buttons("cx").Enabled = True '查询
- .Buttons("bc").Enabled = False '保存
- .Buttons("fq").Enabled = False '放弃
- '录入文本框
- For Jsqte = Max_Text_Index To 0 Step -1
- LrText(Jsqte).Enabled = False
- Next Jsqte
- CmbOut_In.Enabled = False
- Case "11" '浏览(放弃修改单据,查询单据)
- '工具条
- .Buttons("dy").Enabled = True '打印
- .Buttons("yl").Enabled = True '预览
- .Buttons("xg").Enabled = True '修改
- .Buttons("Fill").Enabled = False '填充
- .Buttons("bc").Enabled = False '保存
- .Buttons("fq").Enabled = False '放弃
- '录入文本框
- For Jsqte = 0 To Max_Text_Index
- LrText(Jsqte).Enabled = False
- Next Jsqte
- CmbOut_In.Enabled = False
- Case "30" '修改
- '工具条
- .Buttons("dy").Enabled = False '打印
- .Buttons("yl").Enabled = False '预览
- .Buttons("xg").Enabled = False '修改
- .Buttons("Fill").Enabled = True '填充
- .Buttons("bc").Enabled = True '保存
- .Buttons("fq").Enabled = True '放弃
- '录入文本框
- For Jsqte = 0 To Max_Text_Index
- LrText(Jsqte).Enabled = True
- Next Jsqte
- CmbOut_In.Enabled = True
- LrText(0).SetFocus
- End Select
- End With
- End Sub
- Private Sub Sub_EditBill() '修改一张单据
- '判断当前凭证是否允许修改
- If Not Fun_AllowEdit Then
- Exit Sub
- End If
- '设置操作状态为修改
- Lab_OperStatus.Caption = "3"
- '设置工具条状态
- Call Sub_OperStatus("30")
- End Sub
- Private Function Fun_AllowEdit() As Boolean
- Fun_AllowEdit = True
- End Function
- Private Sub Sub_AbandonBill() '放弃对当前单据的操作
- '先关闭录入载体
- Select Case Trim(Lab_OperStatus.Caption)
- Case "3" '修改状态
- '重新显示当前单据
- Call Sub_ShowBill
- '设置操作状态为浏览
- Lab_OperStatus = "1"
- Call Sub_OperStatus("11")
- End Select
- End Sub
- Private Sub Xldqh() '显露当前行
- Dim Toprowte As Long
- With WglrGrid
- Toprowte = 0
- Do While .CellTop + .RowHeight(.Row) + Fzxwghs * Sjhgd > .Height And .TopRow <> Toprowte
- Toprowte = .TopRow
- .TopRow = .TopRow + 1
- Loop
- Toprowte = 0
- Do While .CellTop < .FixedRows * .RowHeight(0) And .TopRow <> Toprowte
- Toprowte = .TopRow
- .TopRow = .TopRow - 1
- Loop
- End With
- End Sub
- Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button) '表格格式设置(通用)
- Select Case Button.Key
- Case "bcgs" '保存表格格式
- Call Bcwggs(WglrGrid, GridCode, GridStr)
- Case "hfmrgs" '恢复默认格式
- Call Hfmrgs(WglrGrid, GridCode, GridStr)
- End Select
- End Sub
- Private Sub bbyl(bbylte As Boolean) '打印预览(通用)
- Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
- Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
- Bbxbtgs = 1 '报 表 小 标 题 行 数
- Bbbwhgs = 1 '报 表 表 尾 行 数
- ReDim Bbxbt(1 To Bbxbtgs)
- ReDim bbxbtzzxs(1 To Bbxbtgs)
- If Bbbwhgs <> 0 Then
- ReDim Bbbwh(1 To Bbbwhgs)
- ReDim Bbbwhzzxs(1 To Bbbwhgs)
- End If
- Bbzbt = ReportTitle
- bbxbtzzxs(1) = 0 '报表行组织形式(0-居左 1-居中 2-居右)
- Bbxbt(1) = "转帐名称:" + Lbl_AutoAccName '报表行组织形式(0-居左 1-居中 2-居右)
- Call Scyxsjb(WglrGrid) '生成报表数据
- Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
- If Not bbylte Then
- Unload DY_Tybbyldy
- End If
- End Sub
- Private Function Sub_SaveBill() As Boolean '保 存 单 据
- Dim Rowjsq As Long '网格行计数器
- Dim Coljsq As Long '网格列计数器
- Dim Int_RowCount As Integer '有效数据行计数器
- Dim Lrywlz As Long '录入有误列值
- Dim Bj As Boolean '辅助项有效标志
- '下面将对所有有效数据行进行有效性判断
- If LrText(0) = "" Then '转帐科目必须输入
- Tsxx = "请输入损益类科目!"
- Call Xtxxts(Tsxx, 0, 4)
- LrText(0).SetFocus
- Exit Function
- End If
- If LrText(1) = "" Then '利润科目必须输入
- Tsxx = "请输入本年利润科目!"
- Call Xtxxts(Tsxx, 0, 4)
- LrText(1).SetFocus
- Exit Function
- End If
- If LrText(2) = "" Then '摘要必须输入
- Tsxx = "请输入摘要!"
- Call Xtxxts(Tsxx, 0, 4)
- LrText(2).SetFocus
- Exit Function
- End If
- Int_RowCount = 0
- With WglrGrid
- For Rowjsq = .FixedRows To .Rows - 1
- '带*号者为有效数据行
- If .TextMatrix(Rowjsq, 0) <> "*" Then
- Exit For
- Else
- Int_RowCount = Int_RowCount + 1
- End If
- '2.[自定义判断(补丁)
- '首先进行为空判断(固定不变)
- For Jsqte = Qslz To .Cols - 1
- If (GridInt(Jsqte, 5) = 1 And Len(Trim(.TextMatrix(Rowjsq, Jsqte))) = 0) Or (GridInt(Jsqte, 5) = 2 And Val(Trim(.TextMatrix(Yxxpdh, Jsqte))) = 0) Then
- Tsxx = GridStr(Jsqte, 2)
- Lrywlz = Jsqte
- GoTo Lrcwcl
- Exit For
- End If
- Next Jsqte
- Next Rowjsq
- If Int_RowCount = 0 Then
- Tsxx = "有效行数为零,不能存盘!"
- Call Xtxxts(Tsxx, 0, 1)
- Exit Function
- End If
- End With '网格
- '如果以上有效性检查均顺利通过,则执行存盘动作
- On Error GoTo Swcwcl
- Cw_DataEnvi.DataConnect.BeginTrans
- '修改单据
- '1.删除原单据所有内容
- Cw_DataEnvi.DataConnect.Execute ("Delete Cwzz_AutoTranItem Where TranCode='" & Trim(Lbl_AutoAccCode.Caption) & "' and TranClass='" & TranClassCode & "'")
- If Rec_AutoAccItem.State = 1 Then Rec_AutoAccItem.Close
- Rec_AutoAccItem.Open "Select * From Cwzz_AutoTranItem Where 1=2", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockPessimistic
- '写网格中的转出科目定义数据
- For Rowjsq = WglrGrid.FixedRows To WglrGrid.Rows - 1
- If WglrGrid.TextMatrix(Rowjsq, 0) <> "*" Then
- Exit For
- End If
- With Rec_AutoAccItem
- .AddNew
- .Fields("TranClass") = TranClassCode
- .Fields("TranCode") = Trim(Lbl_AutoAccCode.Caption) '转帐编号
- .Fields("Digest") = Trim(WglrGrid.TextMatrix(Rowjsq, Sydz("001", GridStr(), Szzls))) '摘要
- .Fields("Ccode") = Trim(WglrGrid.TextMatrix(Rowjsq, Sydz("002", GridStr(), Szzls))) '损益科目
- .Fields("TranOri") = WglrGrid.TextMatrix(Rowjsq, Sydz("004", GridStr(), Szzls)) '转帐方向
- .Fields("TranProp") = "转出" '转帐性质
- .Fields("GetCcode") = Trim(WglrGrid.TextMatrix(Rowjsq, Sydz("002", GridStr(), Szzls))) '本年利润科目
- .Fields("DistriProp") = 100 '若网格内该项没有填写,默认100%
- .Fields("FormulaCode") = "01" '来源数据项目,期末余额
- End With
- Next Rowjsq
- '写转入科目定义数据
- With Rec_AutoAccItem
- .AddNew
- .Fields("TranClass") = TranClassCode
- .Fields("TranCode") = Trim(Lbl_AutoAccCode.Caption) '转帐编号
- .Fields("Digest") = Trim(LrText(2).Text) '摘要
- .Fields("Ccode") = Trim(LrText(1).Text) '损益科目
- If WglrGrid.TextMatrix(WglrGrid.FixedRows, Sydz("004", GridStr(), Szzls)) = "借" Then
- .Fields("TranOri") = "贷" '转帐方向
- Else
- .Fields("TranOri") = "借" '转帐方向
- End If
- .Fields("TranProp") = "转入" '转帐性质
- .Fields("GetCcode") = "" '
- .Fields("DistriProp") = 100 '若网格内该项没有填写,默认100%
- .Fields("FormulaCode") = "05" '来源数据为对方汇总数
- .Update
- End With
- Cw_DataEnvi.DataConnect.CommitTrans
- Sub_SaveBill = True
- Tsxx = "保存完毕! "
- Call Xtxxts(Tsxx, 0, 4)
- '标识单据发生改动
- Bln_BillChange = True
- '设置操作状态为浏览
- Lab_OperStatus = "1"
- Call Sub_OperStatus("11")
- Exit Function
- Swcwcl:
- Cw_DataEnvi.DataConnect.RollbackTrans
- Tsxx = "存盘过程中出现未知错误,程序自动恢复保存前状态!"
- Call Xtxxts(Tsxx, 0, 1)
- Exit Function
- Lrcwcl: '录入错误处理
- With WglrGrid
- Call Xtxxts("(第 " + Trim(Str(Int_RowCount)) + " 条记录)-" + Tsxx, 0, 1)
- changelock = True
- .Select Rowjsq, Lrywlz
- WglrGrid.SetFocus
- changelock = False
- Exit Function
- End With
- End Function
- Private Function TextYxxpd(Index As Integer) As Boolean '文本框有效性判断
- Dim Sqlstr As String
- Dim Findrec As ADODB.Recordset
- If TextValiJudgeLock(Index) Then '文本框内容未曾改变不进行有效性判断
- TextYxxpd = True
- Exit Function
- End If
- If Trim(LrText(Index)) = "" Then
- LrText(Index).Tag = ""
- Call WbklrCl_After(Index)
- TextValiJudgeLock(Index) = True
- TextYxxpd = True
- Exit Function
- End If
- Select Case Textint(Index, 4)
- Case 1 '编码型
- Sqlstr = Trim(Textstr(Index, 5))
- Sqlstr = Replace(Sqlstr, "@", "'" + Trim(LrText(Index).Text) + "'")
- Set Findrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- If Findrec.EOF Then
- Call Xtxxts(Trim(Textstr(Index, 6)), 0, 1)
- LrText(Index).SetFocus
- Exit Function
- Else
- Select Case Textint(Index, 3)
- Case 0
- If Len(Trim(Textstr(Index, 2))) <> 0 Then
- LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
- End If
- If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
- LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
- End If
- Case 1
- If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
- LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
- End If
- If Len(Trim(Textstr(Index, 2))) <> 0 Then
- LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
- End If
- End Select
- End If
- Case 2 '日期型
- If IsDate(LrText(Index).Text) Then
- LrText(Index).Text = Format(LrText(Index).Text, "yyyy-mm-dd")
- Else
- Tsxx = "非法公历日期!(格式:" + Format(Date, "yyyy-mm-dd") + ")"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(Index).SetFocus
- Exit Function
- End If
- Case 3 '其他类型
- If Index = 0 Then
- Sqlstr = "select * from Cwzz_AccCode where CCode='" & Trim(LrText(Index)) & "'"
- Set Findrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- If Findrec.EOF = True Then
- Tsxx = "该科目不存在!"
- GoTo Error1
- End If
- If Trim(Findrec.Fields("StopUse") & "") = True Then
- Tsxx = "该科目已停用!"
- GoTo Error1
- End If
- End If
- If Index = 1 Then
- Sqlstr = "select * from Cwzz_AccCode where ccode='" & Trim(LrText(Index)) & "'"
- Set Findrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- If Findrec.EOF = True Then
- Tsxx = "该科目不存在!"
- GoTo Error1
- End If
- If Trim(Findrec.Fields("EndFlag") & "") <> True Then
- Tsxx = "应填写末级科目!"
- GoTo Error1
- End If
- If Trim(Findrec.Fields("StopUse") & "") = True Then
- Tsxx = "该科目已停用!"
- GoTo Error1
- End If
- End If
- Select Case Textint(Index, 3)
- Case 0
- If Len(Trim(Textstr(Index, 2))) <> 0 Then
- LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
- End If
- If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
- LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
- End If
- Case 1
- If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
- LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
- End If
- If Len(Trim(Textstr(Index, 2))) <> 0 Then
- LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
- End If
- End Select
- End Select
- TextValiJudgeLock(Index) = True
- TextYxxpd = True
- Exit Function
- Error1:
- Call Xtxxts(Tsxx, 0, 1)
- LrText(Index).SetFocus
- TextYxxpd = False
- Exit Function
- End Function
- Private Sub WbklrCl_After(Index As Integer) '文本框录入事后处理程序
- '以下为依据实际情况自定义部分[
- '在此填写文本框录入事后处理程序
- ']以上为依据实际情况自定义部分
- End Sub
- Private Sub LrText_Change(Index As Integer)
- '屏蔽程序改变控制
- If TextChangeLock Then
- Exit Sub
- End If
- TextValiJudgeLock(Index) = False '打开有效性判断锁
- '限制字段录入长度
- TextChangeLock = True '加锁(防止执行Lrtext_Change)
- Select Case Textint(Index, 1)
- Case 8 '金额型
- Call Sjgskz(LrText(Index), Xtjezws - Xtjexsws - 1, Xtjexsws)
- Case 9 '数量型
- Call Sjgskz(LrText(Index), Xtslzws - Xtslxsws - 1, Xtslxsws)
- Case 10 '单价型
- Call Sjgskz(LrText(Index), Xtdjzws - Xtdjxsws - 1, Xtdjxsws)
- Case Else '其他小数类型控制
- If Textint(Index, 6) <> 0 Or Textint(Index, 7) <> 0 Then
- Call Sjgskz(LrText(Index), Textint(Index, 6), Textint(Index, 7))
- End If
- End Select
- TextChangeLock = False '解锁
- End Sub
- Private Sub LrText_GotFocus(Index As Integer) '文本框得到焦点,显示相应信息
- Call TextShow(Index)
- CurTextIndex = Index
- LrText(Index).SelStart = Len(LrText(Index))
- End Sub
- Private Sub LrText_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer) '字段按F2键提供帮助
- Select Case KeyCode
- Case vbKeyF2
- Call Text_Help(Index)
- End Select
- End Sub
- Private Sub LrText_KeyPress(Index As Integer, KeyAscii As Integer) '文本框录入事中控制
- Call InputFieldLimit(LrText(Index), Textint(Index, 1), KeyAscii)
- End Sub
- Private Sub LrText_LostFocus(Index As Integer) '文本框失去焦点进行有效性判断及相应处理
- If Textint(Index, 9) = 0 Or Textint(Index, 9) = 1 Then '事中判断
- Call TextYxxpd(Index)
- End If
- End Sub
- Private Sub Text_Help(Index As Integer) '录入字段帮助
- If Not Textboolean(Index, 1) Then
- Exit Sub
- End If
- TextValiJudgeLock(Index) = True
- '先进行有效性判断
- If Not TextYxxpd(CurTextIndex) Then
- Exit Sub
- End If
- Call Drbmhelp(Textint(Index, 2), Textstr(Index, 4), Trim(LrText(Index).Text))
- If Len(Xtfhcs) <> 0 Then
- If Textint(Index, 3) = 1 Then
- LrText(Index).Text = Xtfhcsfz
- LrText(Index).Tag = Xtfhcs
- Else
- LrText(Index).Text = Xtfhcs
- LrText(Index).Tag = Xtfhcsfz
- End If
- End If
- TextValiJudgeLock(Index) = False
- LrText(Index).SetFocus
- End Sub
- Public Sub Fill_Relation()
- Dim sqlstr1 As String '临时字符串
- If LrText(0) = "" Then
- Tsxx = "请输入损益科目!"
- Call Xtxxts(Tsxx, 0, 4)
- LrText(0).SetFocus
- Exit Sub
- End If
- If LrText(1) = "" Then
- Tsxx = "请输入本年利润科目!"
- Call Xtxxts(Tsxx, 0, 4)
- LrText(1).SetFocus
- Exit Sub
- End If
- If LrText(2) = "" Then
- Tsxx = "请输入摘要信息!"
- Call Xtxxts(Tsxx, 0, 4)
- LrText(2).SetFocus
- Exit Sub
- End If
- '转帐科目(损益科目)记录集
- Sqlstr = "select * from Cwzz_AccCode where Ccode like '" & Trim(LrText(0).Text) & "%' and EndFlag='1' and StopFlag<>'1'"
- Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- If Cxnrrec.EOF = True Then
- Tsxx = "重新选择损益类科目编码!"
- Call Xtxxts(Tsxx, 1, 1)
- Exit Sub
- End If
- '本年利润科目记录集
- sqlstr1 = "select * from Cwzz_AccCode where Ccode='" & Trim(LrText(1).Text) & "' and EndFlag='1' and StopFlag<>'1'"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(sqlstr1)
- If RecTemp.EOF = True Then
- Tsxx = "重新选择利润科目编码!"
- Call Xtxxts(Tsxx, 1, 1)
- Exit Sub
- End If
- With Cxnrrec
- WglrGrid.Clear 1
- If .EOF And .BOF Then
- Exit Sub
- End If
- Jsqte = WglrGrid.FixedRows
- Do While Not .EOF
- If Jsqte >= WglrGrid.Rows Then
- WglrGrid.AddItem ""
- End If
- WglrGrid.TextMatrix(Jsqte, 0) = "*"
- WglrGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = LrText(2)
- WglrGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("CCode"))
- WglrGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = Trim(.Fields("CName"))
- If CmbOut_In.Text = "收入" Then
- WglrGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = "借"
- Else
- WglrGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = "贷"
- End If
- WglrGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = RecTemp.Fields("Ccode") & ""
- WglrGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = RecTemp.Fields("Cname") & ""
- WglrGrid.RowHeight(Jsqte) = Sjhgd
- .MoveNext
- Jsqte = Jsqte + 1
- Loop
- End With
- '修改]
- End Sub
- Private Sub TextShow(Index As Integer) '文本框得到焦点,显示相应信息
- If Textboolean(Index, 1) Then
- Ydcommand1.Visible = True
- Ydcommand1.Move LrText(Index).Left + LrText(Index).Width, LrText(Index).Top
- Ydcommand1.Tag = Index
- Else
- Ydcommand1.Tag = ""
- Ydcommand1.Visible = False
- End If
- End Sub
- Private Sub Ydcommand1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
- Call Text_Help(Ydcommand1.Tag)
- End Sub
- Public Sub Bill_Head_Show() '填充窗体的网格之上文本框等内容
- Dim rs_temp1 As New ADODB.Recordset '临时记录集
- Dim rs_temp2 As New ADODB.Recordset '临时记录集
- '取损益科目的数据
- Sqlstr = "SELECT Cwzz_AutoTranItem.TranClass, Cwzz_AutoTranItem.TranCode, " & _
- "Cwzz_AutoTranItem.TranOri,Cwzz_AutoTranItem.Ccode,Cwzz_AutoTranItem.Digest, " & _
- "Cwzz_AutoTranItem.GetCcode,Cwzz_AutoTranItem.FormulaCode " & _
- "FROM Cwzz_AutoTranMain RIGHT OUTER JOIN Cwzz_AutoTranItem ON " & _
- "Cwzz_AutoTranMain.TranCode = Cwzz_AutoTranItem.TranCode AND " & _
- "Cwzz_AutoTranMain.TranClass = Cwzz_AutoTranItem.TranClass " & _
- "where Cwzz_AutoTranItem.TranCode='" & Lbl_AutoAccCode.Caption & "' " & _
- "and Cwzz_AutoTranItem.tranclass='" & TranClassCode & "'" & _
- "and Cwzz_AutoTranItem.FormulaCode<>'05' order by Cwzz_AutoTranItem.Ccode"
- Set Rec_AutoAccItem = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- If Rec_AutoAccItem.Fields("TranOri") = "借" Then
- CmbOut_In.Text = "收入"
- Else
- CmbOut_In.Text = "支出"
- End If
- LrText(2).Text = Rec_AutoAccItem.Fields("Digest")
- '转帐科目编码
- If Rec_AutoAccItem.Fields("Ccode") & "" <> "" Then
- Sqlstr = "Select * from Cwzz_AccCode where Ccode='" & Trim(Rec_AutoAccItem.Fields("Ccode") & "") & "' order by Ccode"
- Set rs_temp1 = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- If rs_temp1.EOF = False Then
- LrText(0).Text = Trim(rs_temp1.Fields("ParentCode") & "")
- Else
- LrText(0).Text = ""
- End If
- End If
- '取本年利润的数据
- Sqlstr = "SELECT Cwzz_AutoTranItem.TranClass, Cwzz_AutoTranItem.TranCode, " & _
- "Cwzz_AutoTranItem.TranOri,Cwzz_AutoTranItem.Ccode,Cwzz_AutoTranItem.Digest, " & _
- "Cwzz_AutoTranItem.GetCcode " & _
- "FROM Cwzz_AutoTranMain RIGHT OUTER JOIN Cwzz_AutoTranItem ON " & _
- "Cwzz_AutoTranMain.TranCode = Cwzz_AutoTranItem.TranCode AND " & _
- "Cwzz_AutoTranMain.TranClass = Cwzz_AutoTranItem.TranClass " & _
- "where Cwzz_AutoTranItem.TranCode='" & Lbl_AutoAccCode.Caption & "' " & _
- "and Cwzz_AutoTranItem.tranclass='" & TranClassCode & "'" & _
- "and Cwzz_AutoTranItem.FormulaCode='05'"
- Set Rec_AutoAccItem = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- If Trim(Rec_AutoAccItem.Fields("Ccode") & "") <> "" Then
- Sqlstr = "select * from Cwzz_AccCode where Ccode='" & Trim(Rec_AutoAccItem.Fields("Ccode") & "") & "' "
- Set rs_temp2 = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- If rs_temp2.EOF = False Then
- LrText(1).Text = Trim(rs_temp2.Fields("CCode") & "")
- Lab_GetName.Caption = Trim(rs_temp2.Fields("CName") & "") '为下一步网格内显示用
- Else
- LrText(1).Text = ""
- End If
- End If
- End Sub