+
资源名称:ERPSYS.zip [点击查看]
上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:87k
源码类别:
企业管理
开发平台:
Visual Basic
- VERSION 5.00
- Object = "{C5DE3F80-3376-11D2-BAA4-04F205C10000}#1.0#0"; "Vsflex6d.ocx"
- Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
- Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
- Begin VB.Form JC_KjkmszFrm
- BorderStyle = 1 'Fixed Single
- Caption = "会计科目设置"
- ClientHeight = 7095
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 9375
- HelpContextID = 2001
- Icon = "基础设置_会计科目设置.frx":0000
- KeyPreview = -1 'True
- LinkTopic = "Form2"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 7095
- ScaleWidth = 9375
- StartUpPosition = 2 '屏幕中心
- Begin TabDlg.SSTab StTab
- Height = 6375
- Left = 30
- TabIndex = 0
- Top = 690
- Width = 9330
- _ExtentX = 16457
- _ExtentY = 11245
- _Version = 393216
- Style = 1
- Tabs = 2
- TabHeight = 520
- TabCaption(0) = "列表视图"
- TabPicture(0) = "基础设置_会计科目设置.frx":1042
- Tab(0).ControlEnabled= -1 'True
- Tab(0).Control(0)= "CzxsGrid"
- Tab(0).Control(0).Enabled= 0 'False
- Tab(0).ControlCount= 1
- TabCaption(1) = "单张视图"
- TabPicture(1) = "基础设置_会计科目设置.frx":105E
- Tab(1).ControlEnabled= 0 'False
- Tab(1).Control(0)= "Frame1"
- Tab(1).ControlCount= 1
- Begin VB.Frame Frame1
- Height = 5955
- Left = -74910
- TabIndex = 26
- Top = 330
- Width = 9135
- Begin VB.Frame Frame5
- Caption = "打印"
- ForeColor = &H00FF0000&
- Height = 990
- Left = 270
- TabIndex = 44
- Top = 4860
- Width = 3600
- Begin VB.TextBox LrText
- Height = 300
- Index = 6
- Left = 1020
- TabIndex = 48
- Text = "6"
- Top = 570
- Width = 2430
- End
- Begin VB.CheckBox Chk_SumPrint
- Caption = "汇总打印"
- Height = 240
- Left = 180
- TabIndex = 11
- Top = 255
- Width = 1185
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- Caption = "汇总科目:"
- Height = 180
- Left = 195
- TabIndex = 45
- Top = 630
- Width = 810
- End
- End
- Begin VB.CheckBox Chk_DayBookFlag
- Caption = "日记帐"
- Height = 225
- Left = 4410
- TabIndex = 21
- Top = 4050
- Width = 1065
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 5
- Left = 1110
- TabIndex = 6
- Text = "5"
- Top = 2340
- Width = 1725
- End
- Begin VB.CheckBox Chk_CashFlow
- Caption = "现金或现金等价物"
- Height = 315
- Left = 4410
- TabIndex = 22
- Top = 4320
- Width = 1785
- End
- Begin VB.Frame Frame4
- Caption = "项目核算(I)"
- ForeColor = &H00FF0000&
- Height = 945
- Left = 4380
- TabIndex = 40
- Top = 2940
- Width = 2955
- Begin VB.CommandButton Ydcommand1
- Height = 300
- Index = 4
- Left = 2550
- Picture = "基础设置_会计科目设置.frx":107A
- Style = 1 'Graphical
- TabIndex = 42
- Top = 540
- Visible = 0 'False
- Width = 300
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 4
- Left = 870
- TabIndex = 20
- Text = "4"
- Top = 540
- Width = 1680
- End
- Begin VB.CheckBox Chk_Ass
- Caption = "项目核算"
- Height = 255
- Index = 3
- Left = 90
- TabIndex = 19
- Top = 270
- Width = 1335
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- Caption = "项目类别:"
- Height = 180
- Index = 4
- Left = 60
- TabIndex = 41
- Top = 600
- Width = 810
- End
- End
- Begin VB.CommandButton BcCommand
- Caption = "保存(&S)"
- Height = 300
- Left = 4530
- TabIndex = 23
- Top = 5430
- Width = 1120
- End
- Begin VB.CommandButton QxCommand
- Cancel = -1 'True
- Caption = "取消(&C)"
- Height = 300
- Left = 5730
- TabIndex = 24
- Top = 5430
- Width = 1120
- End
- Begin VB.CheckBox ChkStopUse
- Caption = "停用"
- Height = 315
- Left = 4380
- TabIndex = 12
- Top = 180
- Width = 705
- End
- Begin VB.ComboBox Combo_AccFormat
- Height = 300
- Left = 1125
- Style = 2 'Dropdown List
- TabIndex = 5
- Top = 1920
- Width = 1725
- End
- Begin VB.Frame Frame3
- Caption = "外币核算(&F)"
- ForeColor = &H00FF0000&
- Height = 975
- Left = 270
- TabIndex = 36
- Top = 2730
- Width = 3615
- Begin VB.CommandButton Ydcommand1
- Height = 300
- Index = 2
- Left = 3150
- Picture = "基础设置_会计科目设置.frx":1404
- Style = 1 'Graphical
- TabIndex = 39
- Top = 540
- Visible = 0 'False
- Width = 300
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 2
- Left = 990
- TabIndex = 8
- Text = "2"
- Top = 540
- Width = 2160
- End
- Begin VB.CheckBox Chk_ForiFlag
- Caption = "外币核算"
- Height = 225
- Left = 180
- TabIndex = 7
- Top = 270
- Width = 2055
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- Caption = "核算币种:"
- Height = 180
- Index = 6
- Left = 180
- TabIndex = 37
- Top = 600
- Width = 810
- End
- End
- Begin VB.Frame Frame2
- Caption = "数量核算(&Q)"
- ForeColor = &H00FF0000&
- Height = 1035
- Index = 2
- Left = 270
- TabIndex = 34
- Top = 3780
- Width = 3615
- Begin VB.TextBox LrText
- Height = 300
- Index = 3
- Left = 990
- TabIndex = 10
- Text = "3"
- Top = 570
- Width = 2460
- End
- Begin VB.CheckBox Chk_QuatFlag
- Caption = "数量核算"
- Height = 255
- Left = 180
- TabIndex = 9
- Top = 270
- Width = 2385
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- Caption = "计量单位:"
- Height = 180
- Index = 5
- Left = 180
- TabIndex = 35
- Top = 630
- Width = 810
- End
- End
- Begin VB.Frame Frame2
- Caption = "辅助核算(&A)"
- ForeColor = &H00FF0000&
- Height = 1395
- Index = 1
- Left = 4380
- TabIndex = 33
- Top = 1470
- Width = 1695
- Begin VB.CheckBox Chk_Ass
- Caption = "供应商往来"
- Height = 255
- Index = 4
- Left = 180
- TabIndex = 16
- Top = 510
- Width = 1335
- End
- Begin VB.CheckBox Chk_Ass
- Caption = "个人往来"
- Height = 255
- Index = 2
- Left = 180
- TabIndex = 18
- Top = 1050
- Width = 1335
- End
- Begin VB.CheckBox Chk_Ass
- Caption = "部门"
- Height = 255
- Index = 1
- Left = 180
- TabIndex = 17
- Top = 795
- Width = 1335
- End
- Begin VB.CheckBox Chk_Ass
- Caption = "客户往来"
- Height = 255
- Index = 0
- Left = 180
- TabIndex = 15
- Top = 240
- Width = 1335
- End
- End
- Begin VB.Frame Frame2
- Caption = "余额方向(&O)"
- ForeColor = &H00FF0000&
- Height = 825
- Index = 0
- Left = 4380
- TabIndex = 32
- Top = 540
- Width = 1695
- Begin VB.OptionButton Opt_Yefx
- Caption = "贷方"
- Height = 225
- Index = 1
- Left = 150
- TabIndex = 14
- Top = 510
- Width = 1215
- End
- Begin VB.OptionButton Opt_Yefx
- Caption = "借方"
- Height = 225
- Index = 0
- Left = 150
- TabIndex = 13
- Top = 240
- Width = 1215
- End
- End
- Begin VB.ComboBox Combo_Prop
- Height = 300
- Left = 1125
- Style = 2 'Dropdown List
- TabIndex = 4
- Top = 1485
- Width = 1725
- End
- Begin VB.ComboBox Combo_Class
- Height = 300
- Left = 1125
- Style = 2 'Dropdown List
- TabIndex = 3
- Top = 1065
- Width = 1725
- End
- Begin VB.CommandButton Ydcommand1
- Height = 300
- Index = 0
- Left = 8370
- Picture = "基础设置_会计科目设置.frx":178E
- Style = 1 'Graphical
- TabIndex = 27
- Top = 1320
- Visible = 0 'False
- Width = 300
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 1
- Left = 1125
- TabIndex = 2
- Text = "1"
- Top = 660
- Width = 2775
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 0
- Left = 1140
- TabIndex = 1
- Text = "0"
- Top = 240
- Width = 1710
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- Caption = "助记码:"
- Height = 180
- Index = 8
- Left = 270
- TabIndex = 43
- Top = 2400
- Width = 630
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- Caption = "帐页格式:"
- Height = 180
- Index = 7
- Left = 285
- TabIndex = 38
- Top = 1980
- Width = 810
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- Caption = "科目性质:"
- Height = 180
- Index = 2
- Left = 285
- TabIndex = 31
- Top = 1545
- Width = 810
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- Caption = "科目类型:"
- Height = 180
- Index = 3
- Left = 285
- TabIndex = 30
- Top = 1125
- Width = 810
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- Caption = "科目名称:"
- Height = 180
- Index = 1
- Left = 285
- TabIndex = 29
- Top = 720
- Width = 810
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- Caption = "科目编码:"
- Height = 180
- Index = 0
- Left = 285
- TabIndex = 28
- Top = 300
- Width = 810
- End
- End
- Begin VSFlex6DAOCtl.vsFlexGrid CzxsGrid
- Height = 5895
- Left = 90
- TabIndex = 25
- Top = 390
- Width = 9135
- _ExtentX = 16113
- _ExtentY = 10398
- _ConvInfo = 1
- 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 = 8421504
- 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
- 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 'False
- ShowComboButton = -1 'True
- WordWrap = 0 'False
- TextStyle = 0
- TextStyleFixed = 0
- OleDragMode = 0
- OleDropMode = 0
- DataMode = 0
- VirtualData = -1 'True
- End
- End
- Begin MSComctlLib.ImageList ImageList1
- Left = 0
- Top = 420
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 16
- ImageHeight = 16
- MaskColor = 12632256
- _Version = 393216
- BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
- NumListImages = 29
- BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_会计科目设置.frx":1B18
- Key = "sz"
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_会计科目设置.frx":1EB2
- Key = "dy"
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_会计科目设置.frx":224C
- Key = "yl"
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_会计科目设置.frx":25E6
- Key = "xg"
- EndProperty
- BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_会计科目设置.frx":2980
- Key = "zh"
- EndProperty
- BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_会计科目设置.frx":2D1A
- Key = "sh"
- EndProperty
- BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_会计科目设置.frx":30B4
- Key = "bc"
- EndProperty
- BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_会计科目设置.frx":344E
- Key = "fq"
- EndProperty
- BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_会计科目设置.frx":37E8
- Key = "bz"
- EndProperty
- BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_会计科目设置.frx":3B82
- Key = "tc"
- EndProperty
- BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_会计科目设置.frx":3F1C
- Key = "bcgs"
- EndProperty
- BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_会计科目设置.frx":42B6
- Key = "mrlk"
- EndProperty
- BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_会计科目设置.frx":4650
- Key = "xsxm"
- EndProperty
- BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_会计科目设置.frx":49EA
- Key = "first"
- EndProperty
- BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_会计科目设置.frx":4D84
- Key = "prev"
- EndProperty
- BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_会计科目设置.frx":511E
- Key = "next"
- EndProperty
- BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_会计科目设置.frx":54B8
- Key = "last"
- EndProperty
- BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_会计科目设置.frx":5852
- Key = "xx"
- EndProperty
- BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_会计科目设置.frx":5BEC
- Key = "define"
- EndProperty
- BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_会计科目设置.frx":5F86
- Key = "exec"
- EndProperty
- BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_会计科目设置.frx":6320
- Key = "xz"
- EndProperty
- BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_会计科目设置.frx":66BA
- Key = "sc"
- EndProperty
- BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_会计科目设置.frx":6A54
- Key = "sx"
- EndProperty
- BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_会计科目设置.frx":6DEE
- Key = "cx"
- EndProperty
- BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_会计科目设置.frx":7188
- Key = "zd"
- EndProperty
- BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_会计科目设置.frx":7522
- Key = "dz"
- EndProperty
- BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_会计科目设置.frx":78BC
- Key = "ph"
- EndProperty
- BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_会计科目设置.frx":7C56
- Key = "fz"
- EndProperty
- BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_会计科目设置.frx":7FF0
- Key = "dw"
- EndProperty
- EndProperty
- End
- Begin MSComctlLib.Toolbar SzToolbar
- Align = 1 'Align Top
- Height = 570
- Left = 0
- TabIndex = 46
- Top = 0
- Width = 9375
- _ExtentX = 16536
- _ExtentY = 1005
- ButtonWidth = 820
- ButtonHeight = 953
- AllowCustomize = 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"
- 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 = "zj"
- Object.ToolTipText = "点击或按Ctrl+A增加记录"
- ImageKey = "xz"
- EndProperty
- BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "修改"
- Key = "xg"
- ImageKey = "xg"
- EndProperty
- BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "删除"
- Key = "sc"
- Object.ToolTipText = "点击或按Ctrl+D删除当前记录"
- ImageKey = "sc"
- EndProperty
- BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "定位"
- Key = "dw"
- ImageKey = "dw"
- EndProperty
- BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "刷新"
- Key = "sx"
- ImageKey = "sx"
- EndProperty
- BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628}
- 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 = 540
- Left = 6870
- TabIndex = 47
- Top = 0
- Width = 2475
- _ExtentX = 4366
- _ExtentY = 953
- ButtonWidth = 1455
- ButtonHeight = 953
- AllowCustomize = 0 'False
- Appearance = 1
- Style = 1
- ImageList = "ImageList1"
- _Version = 393216
- BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
- NumButtons = 3
- 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
- BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "显示项目"
- Key = "szxsxm"
- ImageKey = "xsxm"
- EndProperty
- EndProperty
- End
- End
- End
- Attribute VB_Name = "JC_KjkmszFrm"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '*******************************************************
- '* 模 块 名 称 :会计科目设置
- '* 功 能 描 述 :设置公司会计科目
- '* 程序员姓名 :张建忠
- '* 最后修改人 :张建忠
- '* 最后修改时间:2001/11/17
- '* 备 注:
- '*******************************************************
- Dim Rec_CodeSet As New ADODB.Recordset '编码设置表
- Dim RecCodeScheme As New ADODB.Recordset '系统编码方案表
- Dim RecTemp As Recordset '临时使用动态集
- Dim Int_CodeScheme() As Integer '会计科目编码方案
- Dim Int_CodeLev As Integer '会计科目编码级次
- Dim jdzygs As Integer '控件焦点转移个数
- Dim Lrzt As Integer '录入状态标志(0-非录入状态 1-增加 2-修改)
- Dim ReportTitle As String '报表主标题
- Dim Bln_ChkAssLock As Boolean '辅助核算控制锁
- '以下为固定使用变量(网格)
- Dim Cxnrrec As New ADODB.Recordset '显示查询内容动态集
- Dim Dyymctbl As New DY_Dyymsz '打印页面窗体变量
- Dim GridCode As String '显示网格网格代码
- Dim GridInf() As Variant '整个网格设置信息
- Dim Tsxx As String '系统提示信息
- Dim Qslz As Long '网格隐藏(非操作显示)列数
- Dim Sjhgd As Double '网格数据行高度
- Dim GridBoolean() As Boolean '网格列信息(布尔型)
- Dim GridStr() As String '网格列信息(字符型)
- Dim GridInt() As Integer '网格列信息(整型)
- 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 '文本框录入有效性判断控制锁
- Dim CurTextIndex As Integer '当前文本框索引值
- Dim TextChangeLock As Boolean '文本框内容变换控制锁
- Dim Bln_Cancel As Boolean '取消按钮信息传递
- Private Sub Form_KeyPress(KeyAscii As Integer) '控 制 焦 点 转 移
- jdzygs = 25
- 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()
- '打印报表标题信息
- ReportTitle = "会 计 科 目 表"
- '调入打印页面设置窗体
- XtReportCode = "Cwzz_Kjkmsz"
- Load Dyymctbl
- '以下为文本框处理程序(读入文本框录入信息)
- TextGroupCode = "Cwzz_Kjkmsz"
- Call Drwbkxx(TextGroupCode, Textvar(), Textboolean(), Textint(), Textstr())
- Call Wbkcsh
- '调入网格设置信息
- GridCode = "Cwzz_Kjkmsz"
- Call BzWgcsh(CzxsGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
- Qslz = GridInf(1)
- Sjhgd = GridInf(2)
- Szzls = CzxsGrid.Cols - 1
- '填 充 网 格
- Call Cxnrtcwg
- '初始化ToolBar,Tab卡状态
- StTab.Tab = 0
- StTab.TabEnabled(1) = False
- Frame1.Enabled = False
- '设置为非录入状态
- Lrzt = 0
- '初始化科目类型列表框
- Call FillCombo(Combo_Class, "Cwzz_Kmlx", "", 0)
- '初始化科目性质列表框
- Call FillCombo(Combo_Prop, "Cwzz_Kmxz", "", 0)
- '初始化帐页格式列表框
- Call FillCombo(Combo_AccFormat, "Cwzz_Zygs", "", 0)
- '读入会计科目编码方案
- Set RecCodeScheme = Cw_DataEnvi.DataConnect.Execute("Select CodeScheme From Gy_CodeScheme Where ItemCode='Cwzz_Kmcode'")
- With RecCodeScheme
- If Not .EOF Then
- Int_CodeLev = Len(Trim(.Fields("CodeScheme")))
- ReDim Int_CodeScheme(Int_CodeLev)
- lenjsq = 0
- For jsqte = 1 To Int_CodeLev
- lenjsq = lenjsq + Mid(Trim(.Fields("CodeScheme")), jsqte, 1)
- Int_CodeScheme(jsqte) = lenjsq
- Next jsqte
- End If
- .Close
- End With
- '初始化余额方向
- Opt_Yefx(0).Value = True
- '初始化外币 数量 项目核算标志 汇总打印
- Call Textwx(LrText(2))
- Call Textwx(LrText(3))
- Ydcommand1(2).Enabled = False
- Call Textwx(LrText(4))
- Ydcommand1(4).Enabled = False
- Call Textwx(LrText(6))
- End Sub
- Private Sub Cxnrtcwg() '查询内容填充网格
- Dim SqlStr As String '查询连接串
- Dim jsqte As Long '查询临时使用变量
- '为加快显示速度,将网格刷新动作冻结
- CzxsGrid.Redraw = False
- '[>>查询连接串
- SqlStr = "SELECT Cwzz_AccCode.*, Gy_ForeignCurrency.ForeignCurrName FROM Cwzz_AccCode LEFT OUTER JOIN" & _
- " Gy_ForeignCurrency ON" & _
- " Cwzz_AccCode.ForeignCurrCode = Gy_ForeignCurrency.ForeignCurrCode order by Ccode"
- '<<]
- Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(SqlStr)
- With Cxnrrec
- CzxsGrid.Rows = CzxsGrid.FixedRows
- If .EOF And .BOF Then
- CzxsGrid.Redraw = True
- Exit Sub
- End If
- jsqte = CzxsGrid.FixedRows
- Do While Not .EOF
- CzxsGrid.AddItem ""
- Call Jltcwg(Cxnrrec, jsqte) '调入填充网格子过程
- CzxsGrid.RowHeight(jsqte) = Sjhgd '设置网格高度
- .MoveNext
- jsqte = jsqte + 1
- Loop
- End With
- '将网格刷新动作解冻
- CzxsGrid.Redraw = True
- End Sub
- Private Sub Jltcwg(Jlbrec As ADODB.Recordset, Rowjsq As Long) '记录内容填充网格
- Dim Str_Fzhs As String '辅助核算
- '[以下为自定义部分
- With Jlbrec
- CzxsGrid.TextMatrix(Rowjsq, Sydz("001", GridStr(), Szzls)) = Trim(.Fields("CClass"))
- CzxsGrid.TextMatrix(Rowjsq, Sydz("002", GridStr(), Szzls)) = .Fields("CodeLevel")
- CzxsGrid.TextMatrix(Rowjsq, Sydz("003", GridStr(), Szzls)) = Trim(.Fields("CCode") & "")
- CzxsGrid.TextMatrix(Rowjsq, Sydz("004", GridStr(), Szzls)) = Trim(.Fields("Cname") & "")
- CzxsGrid.TextMatrix(Rowjsq, Sydz("005", GridStr(), Szzls)) = Trim(.Fields("ForeignCurrName") & "")
- CzxsGrid.TextMatrix(Rowjsq, Sydz("006", GridStr(), Szzls)) = Trim(.Fields("Measure") & "")
- CzxsGrid.TextMatrix(Rowjsq, Sydz("007", GridStr(), Szzls)) = Trim(.Fields("Cproperty") & "")
- Str_Fzhs = ""
- If .Fields("DeptFlag") Then
- Str_Fzhs = Str_Fzhs + "部门 "
- End If
- If .Fields("CusFlag") Then
- Str_Fzhs = Str_Fzhs + "客户 "
- End If
- If .Fields("SupplierFlag") Then
- Str_Fzhs = Str_Fzhs + "供应商 "
- End If
- If .Fields("PersonFlag") Then
- Str_Fzhs = Str_Fzhs + "个人 "
- End If
- If .Fields("ItemFlag") Then
- Str_Fzhs = Str_Fzhs + "项目 "
- End If
- CzxsGrid.TextMatrix(Rowjsq, Sydz("008", GridStr(), Szzls)) = Trim(Str_Fzhs)
- CzxsGrid.TextMatrix(Rowjsq, Sydz("009", GridStr(), Szzls)) = Trim(.Fields("AccFormat") & "")
- CzxsGrid.TextMatrix(Rowjsq, Sydz("010", GridStr(), Szzls)) = Trim(.Fields("BalanceOri") & "")
- CzxsGrid.TextMatrix(Rowjsq, Sydz("011", GridStr(), Szzls)) = Trim(.Fields("StopFlag") & "")
- CzxsGrid.TextMatrix(Rowjsq, Sydz("012", GridStr(), Szzls)) = Trim(.Fields("AssCode") & "")
- End With
- '以上为自定义部分]
- End Sub
- Private Sub Form_Unload(Cancel As Integer) '窗体卸载
- Set Cxnrrec = Nothing
- Set Rec_CodeSet = Nothing
- Unload Dyymctbl
- End Sub
- Private Function Bclrsj() As Boolean '判断录入数据有效性,并保存数据
- Dim jsqte As Integer
- Dim Str_Parent As String '上级科目号
- Dim CodeLength As Integer '录入科目长度
- Dim CodeLev As Integer '录入科目级次
- '对文本框录入内容进行为零和为空判断(固定不变)
- With Rec_CodeSet
- For jsqte = 0 To Max_Text_Index
- If Textint(jsqte, 8) = 1 Then '字段不能为空
- If Len(Trim(LrText(jsqte).Text)) = 0 Then
- Tsxx = Textstr(jsqte, 7) & "不能为空!"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(jsqte).SetFocus
- Bclrsj = False
- Exit Function
- End If
- Else
- If Textint(jsqte, 8) = 2 Then '字段不能为零
- If Val(Trim(LrText(jsqte).Text)) = 0 Then
- Tsxx = Textstr(jsqte, 7) & "不能为零!"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(jsqte).SetFocus
- Bclrsj = False
- Exit Function
- End If
- End If
- End If
- Next jsqte
- '如有外币核算,则外币栏不能为空
- If Chk_ForiFlag.Value = 1 Then
- If Len(Trim(LrText(2).Text)) = 0 Then
- Tsxx = "科目进行外币核算,则外币项不能为空!"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(2).SetFocus
- Bclrsj = False
- Exit Function
- End If
- End If
- '如有数量核算,则数量栏不能为空
- If Chk_QuatFlag.Value = 1 Then
- If Len(Trim(LrText(3).Text)) = 0 Then
- Tsxx = "科目进行数量核算,则数量项不能为空!"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(3).SetFocus
- Bclrsj = False
- Exit Function
- End If
- End If
- '如有项目核算,则项目类别栏不能为空
- If Chk_Ass(3).Value = 1 Then
- If Len(Trim(LrText(4).Text)) = 0 Then
- Tsxx = "科目进行项目核算,则项目类别项不能为空!"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(4).SetFocus
- Bclrsj = False
- Exit Function
- End If
- End If
- '对需要进行事后判断的文本框录入内容进行有效性判断 (固定不变)
- For jsqte = 0 To Max_Text_Index
- If Textint(jsqte, 9) = 0 Or Textint(jsqte, 9) = 2 Then
- If Not TextYxxpd(jsqte) Then
- Exit Function
- End If
- End If
- Next jsqte
- If Lrzt = 1 Then '增 加
- '判断科目编码是否符合规则,如有效则同时计算科目级次和上级科目编码
- For jsqte = 1 To Int_CodeLev
- If Int_CodeScheme(jsqte) = Len(Trim(LrText(0).Text)) Then
- CodeLev = jsqte
- Exit For
- End If
- Next jsqte
- If jsqte <= CodeLev Then
- If jsqte > 1 Then
- Str_Parent = Mid(Trim(LrText(0).Text), 1, Int_CodeScheme(jsqte - 1))
- Else
- Str_Parent = ""
- End If
- Else
- Tsxx = "科目编码不符合编码规则!"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(0).SetFocus
- Bclrsj = False
- Exit Function
- End If
- '判断此科目是否已建立上级科目
- If Str_Parent <> "" Then
- Set Rec_CodeSet = Cw_DataEnvi.DataConnect.Execute("SELECT CCode,StopFlag FROM Cwzz_AccCode Where CCode='" & Trim(Str_Parent) & "'")
- If Rec_CodeSet.EOF Then
- Tsxx = "请先建立其上级科目编码!"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(0).Text = Str_Parent
- LrText(0).SelStart = Len(LrText(0).Text)
- LrText(0).SetFocus
- Bclrsj = False
- Exit Function
- Else
- If Rec_CodeSet.Fields("StopFlag") Then
- Tsxx = "其上级科目编码已停用,不能建立下级科目!"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(0).SetFocus
- Bclrsj = False
- Exit Function
- End If
- End If
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute("SELECT Top 1 CCode FROM Cwzz_AccVouchSub Where CCode='" & Trim(Str_Parent) & "'")
- If Not RecTemp.EOF Then
- Tsxx = "科目编码(" + Str_Parent + ")已使用,不能建立下级科目!"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(0).SelStart = Len(LrText(0).Text)
- LrText(0).SetFocus
- Bclrsj = False
- Exit Function
- End If
- End If
- '[>>判断编码是否重复
- If .State = 1 Then .Close
- .Open "SELECT * FROM Cwzz_AccCode WHERE Ccode= '" + Trim(LrText(0).Text) + "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
- If Not .EOF Then
- Tsxx = "科目编码重复!"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(0).SetFocus
- Bclrsj = False
- Exit Function
- End If
- '判断名称是否重复
- If .State = 1 Then .Close
- .Open "SELECT * FROM Cwzz_AccCode WHERE Cname= '" + Trim(LrText(1).Text) + "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
- If Not .EOF Then
- Tsxx = "科目名称重复!"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(1).SetFocus
- Bclrsj = False
- Exit Function
- End If
- '判断助记码是否唯一
- If Trim(LrText(5).Text) <> "" Then
- If .State = 1 Then .Close
- .Open "SELECT * FROM Cwzz_AccCode WHERE AssCode= '" + Trim(LrText(5).Text) + "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
- If Not .EOF Then
- Tsxx = "助记码不唯一!"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(5).SetFocus
- Bclrsj = False
- Exit Function
- End If
- End If
- '如果科目汇总打印则其汇总科目不能为空且为其上级科目
- If Chk_SumPrint.Value = 1 Then
- If Len(Trim(LrText(6).Text)) = 0 Then
- Tsxx = "科目进行汇总打印,则汇总科目不能为空!"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(6).SetFocus
- Bclrsj = False
- Exit Function
- Else
- If InStr(1, Trim(LrText(0).Text), Trim(LrText(6).Text)) = 0 Then
- Tsxx = "汇总打印科目必须为其上级科目!"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(6).SetFocus
- Bclrsj = False
- Exit Function
- End If
- '判断汇总科目是否存在
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute("Select Ccode From Cwzz_AccCode Where Ccode='" & Trim(LrText(6).Text) & "'")
- If RecTemp.EOF Then
- Tsxx = "汇总打印科目不存在!"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(6).SetFocus
- Bclrsj = False
- Exit Function
- End If
- End If
- End If
- '判断记录内容无误后,将记录内容写入数据表
- On Error GoTo Swcwcl
- Cw_DataEnvi.DataConnect.BeginTrans
- .AddNew
- .Fields("Cclass") = Combo_Class.Text '科目类型
- .Fields("ParentCode") = Str_Parent '上级科目编码
- .Fields("Ccode") = Trim(LrText(0).Text) '科目编码
- .Fields("AssCode") = Trim(LrText(5).Text) '助记码
- .Fields("Cname") = Trim(LrText(1).Text) '科目名称
- .Fields("CodeLevel") = CodeLev '科目级次
- .Fields("CProperty") = Combo_Prop.Text '科目性质
- .Fields("AccFormat") = Combo_AccFormat.Text '帐页格式
- If Chk_ForiFlag.Value = 1 Then '外币
- .Fields("ForeignFlag") = 1
- .Fields("ForeignCurrCode") = Trim(LrText(2).Tag)
- Else
- .Fields("ForeignFlag") = 0
- .Fields("ForeignCurrCode") = Null
- End If
- If Chk_QuatFlag.Value = 1 Then '数量单位
- .Fields("QuantityFlag") = 1
- .Fields("Measure") = Trim(LrText(3).Text)
- Else
- .Fields("QuantityFlag") = 0
- .Fields("Measure") = ""
- End If
- If Chk_SumPrint.Value = 1 Then '汇总打印
- .Fields("IIFSum") = 1
- .Fields("cSumCode") = Trim(LrText(6).Text)
- Else
- .Fields("IIFSum") = 1
- .Fields("cSumCode") = Trim(LrText(6).Text)
- End If
- If Opt_Yefx(0) Then '余额方向
- .Fields("BalanceOri") = "借"
- Else
- .Fields("BalanceOri") = "贷"
- End If
- If Chk_Ass(0).Value = 1 Then '客户核算
- .Fields("CusFlag") = 1
- Else
- .Fields("CusFlag") = 0
- End If
- If Chk_Ass(4).Value = 1 Then '供应商核算
- .Fields("SupplierFlag") = 1
- Else
- .Fields("SupplierFlag") = 0
- End If
- If Chk_Ass(1).Value = 1 Then '部门核算
- .Fields("DeptFlag") = 1
- Else
- .Fields("DeptFlag") = 0
- End If
- If Chk_Ass(2).Value = 1 Then '个人核算
- .Fields("PersonFlag") = 1
- Else
- .Fields("PersonFlag") = 0
- End If
- If Chk_Ass(3).Value = 1 Then '项目核算
- .Fields("ItemFlag") = 1
- .Fields("ItemClassCode") = Trim(LrText(4).Tag)
- Else
- .Fields("ItemFlag") = 0
- .Fields("ItemClassCode") = Null
- End If
- If Chk_DayBookFlag.Value = 1 Then '日记帐
- .Fields("DayBookFlag") = 1
- Else
- .Fields("DayBookFlag") = 0
- End If
- If Chk_CashFlow.Value = 1 Then '现金或现金等价物
- .Fields("CashFlowFlag") = 1
- Else
- .Fields("CashFlowFlag") = 0
- End If
- .Fields("EndFlag") = 1 '末级标志
- .Update
- '将上级科目末级标志置0
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute("Update Cwzz_AccCode Set Endflag=0 Where Ccode='" & Trim(Str_Parent) & "'")
- Cw_DataEnvi.DataConnect.CommitTrans
- SqlStr = "SELECT Cwzz_AccCode.*, Gy_ForeignCurrency.ForeignCurrName FROM Cwzz_AccCode LEFT OUTER JOIN" & _
- " Gy_ForeignCurrency ON" & _
- " Cwzz_AccCode.ForeignCurrCode = Gy_ForeignCurrency.ForeignCurrCode WHERE Ccode= '" & Trim(LrText(0).Text) & "'"
- Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(SqlStr)
- With CzxsGrid
- .AddItem ""
- .RowHeight(.Rows - 1) = Sjhgd
- .Select .Rows - 1, Qslz
- Call Jltcwg(Cxnrrec, .Rows - 1)
- End With
- Tsxx = "保存完毕!"
- Call Xtxxts(Tsxx, 0, 4)
- Call Cshlrxx(1)
- LrText(0).SetFocus
- '将网格按科目编码排序
- With CzxsGrid
- .Col = Sydz("003", GridStr(), Szzls)
- CzxsGrid.Sort = flexSortStringAscending
- End With
- Else '否则为修改记录
- If .State = 1 Then .Close
- .Open "SELECT * FROM Cwzz_AccCode WHERE Cname= '" + Trim(LrText(1).Text) + "' and CCode<>'" & Trim(LrText(0).Text) & "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
- If Not .EOF Then
- Tsxx = "科目名称重复!"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(1).SetFocus
- Bclrsj = False
- Exit Function
- End If
- '判断助记码是否唯一
- If Trim(LrText(5).Text) <> "" Then
- If .State = 1 Then .Close
- .Open "SELECT * FROM Cwzz_AccCode WHERE AssCode= '" + Trim(LrText(5).Text) + "' and CCode<>'" & Trim(LrText(0).Text) & "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
- If Not .EOF Then
- Tsxx = "助记码不唯一!"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(5).SetFocus
- Bclrsj = False
- Exit Function
- End If
- End If
- '如果科目汇总打印则其汇总科目不能为空且为其上级科目
- If Chk_SumPrint.Value = 1 Then
- If Len(Trim(LrText(6).Text)) = 0 Then
- Tsxx = "科目进行汇总打印,则汇总科目不能为空!"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(6).SetFocus
- Bclrsj = False
- Exit Function
- Else
- If InStr(1, Trim(LrText(0).Text), Trim(LrText(6).Text)) = 0 Then
- Tsxx = "汇总打印科目必须为其上级科目!"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(6).SetFocus
- Bclrsj = False
- Exit Function
- End If
- '判断汇总科目是否存在
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute("Select Ccode From Cwzz_AccCode Where Ccode='" & Trim(LrText(6).Text) & "'")
- If RecTemp.EOF Then
- Tsxx = "汇总打印科目不存在!"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(6).SetFocus
- Bclrsj = False
- Exit Function
- End If
- End If
- End If
- On Error GoTo Swcwcl
- Cw_DataEnvi.DataConnect.BeginTrans
- If .State = 1 Then .Close
- .Open "SELECT * FROM Cwzz_AccCode WHERE Ccode= '" + Trim(LrText(0).Text) + "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
- If Not .EOF Then
- .Fields("AssCode") = Trim(LrText(5).Text) '助记码
- .Fields("Cclass") = Combo_Class.Text '科目类型
- .Fields("Cname") = Trim(LrText(1).Text) '科目名称
- .Fields("CProperty") = Combo_Prop.Text '科目性质
- .Fields("AccFormat") = Combo_AccFormat.Text '帐页格式
- If Chk_ForiFlag.Value = 1 Then '外币
- .Fields("ForeignFlag") = 1
- .Fields("ForeignCurrCode") = Trim(LrText(2).Tag)
- Else
- .Fields("ForeignFlag") = 0
- .Fields("ForeignCurrCode") = Null
- End If
- If Chk_QuatFlag.Value = 1 Then '数量单位
- .Fields("QuantityFlag") = 1
- .Fields("Measure") = Trim(LrText(3).Text)
- Else
- .Fields("QuantityFlag") = 0
- .Fields("Measure") = ""
- End If
- If Chk_SumPrint.Value = 1 Then '汇总打印
- .Fields("IIFSum") = 1
- .Fields("cSumCode") = Trim(LrText(6).Text)
- Else
- .Fields("IIFSum") = 0
- .Fields("cSumCode") = ""
- End If
- If Opt_Yefx(0) Then '余额方向
- .Fields("BalanceOri") = "借"
- Else
- .Fields("BalanceOri") = "贷"
- End If
- If Chk_Ass(0).Value = 1 Then '客户核算
- .Fields("CusFlag") = 1
- Else
- .Fields("CusFlag") = 0
- End If
- If Chk_Ass(4).Value = 1 Then '供应商核算
- .Fields("SupplierFlag") = 1
- Else
- .Fields("SupplierFlag") = 0
- End If
- If Chk_Ass(1).Value = 1 Then '部门核算
- .Fields("DeptFlag") = 1
- Else
- .Fields("DeptFlag") = 0
- End If
- If Chk_Ass(2).Value = 1 Then '个人核算
- .Fields("PersonFlag") = 1
- Else
- .Fields("PersonFlag") = 0
- End If
- If Chk_Ass(3).Value = 1 Then '项目核算
- .Fields("ItemFlag") = 1
- .Fields("ItemClassCode") = Trim(LrText(4).Tag)
- Else
- .Fields("ItemFlag") = 0
- .Fields("ItemClassCode") = Null
- End If
- If ChkStopUse.Value = 1 Then '停用
- .Fields("StopFlag") = 1
- Else
- .Fields("StopFlag") = 0
- End If
- If Chk_DayBookFlag.Value = 1 Then '日记帐
- .Fields("DayBookFlag") = 1
- Else
- .Fields("DayBookFlag") = 0
- End If
- If Chk_CashFlow.Value = 1 Then '现金或现金等价物
- .Fields("CashFlowFlag") = 1
- Else
- .Fields("CashFlowFlag") = 0
- End If
- .Update
- '修改其下级科目科目类型
- SqlStr = "Update Cwzz_AccCode Set Cclass='" & Combo_Class.Text & "' Where Ccode Like '" & Trim(LrText(0).Text) & "%'"
- Cw_DataEnvi.DataConnect.Execute (SqlStr)
- End If
- Cw_DataEnvi.DataConnect.CommitTrans
- SqlStr = "SELECT Cwzz_AccCode.*, Gy_ForeignCurrency.ForeignCurrName FROM Cwzz_AccCode LEFT OUTER JOIN" & _
- " Gy_ForeignCurrency ON" & _
- " Cwzz_AccCode.ForeignCurrCode = Gy_ForeignCurrency.ForeignCurrCode WHERE Ccode= '" & Trim(LrText(0).Text) & "'"
- Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(SqlStr)
- If Not Cxnrrec.EOF Then
- With CzxsGrid
- Call Jltcwg(Cxnrrec, .Row)
- End With
- End If
- End If
- '保存记录成功,函数返回真值
- Bclrsj = True
- Exit Function
- End With
- Swcwcl:
- Cw_DataEnvi.DataConnect.RollbackTrans
- Tsxx = "存盘过程中出现错误,程序自动恢复保存前状态!"
- Call Xtxxts(Tsxx, 0, 1)
- Exit Function
- End Function
- Private Function Cshlrxx(lrztxx As Integer) As Boolean '初始化录入字段信息
- TextChangeLock = True '关闭文本框Chang事件
- If lrztxx = 1 Then
- '增加新记录时将文本框清空
- For jsqte = 0 To Max_Text_Index
- If Len(Trim(Textstr(jsqte, 1))) <> 0 Then
- LrText(jsqte).Text = ""
- LrText(jsqte).Tag = ""
- End If
- TextValiJudgeLock(jsqte) = True
- Next jsqte
- '[>>
- '在此处可添加新增记录时初始化设置
- Chk_ForiFlag.Value = 0
- Chk_QuatFlag.Value = 0
- Chk_SumPrint.Value = 0
- ChkStopUse.Value = 0
- Opt_Yefx(0).Value = True
- For jsqte = 0 To 3
- Chk_Ass(jsqte).Value = 0
- Next jsqte
- ChkStopUse.Enabled = False
- '<<]
- Else
- '修改记录时根据记录关键字(编码)从数据表中读入其他字段内容
- SqlStr = "SELECT Cwzz_AccCode.*, Gy_ForeignCurrency.ForeignCurrName,Cwzz_ItemClass.ItemClassName FROM Cwzz_AccCode LEFT OUTER JOIN" & _
- " Gy_ForeignCurrency ON" & _
- " Cwzz_AccCode.ForeignCurrCode = Gy_ForeignCurrency.ForeignCurrCode LEFT OUTER JOIN" & _
- " Cwzz_ItemClass ON" & _
- " Cwzz_AccCode.ItemClassCode = Cwzz_ItemClass.ItemClassCode Where CCode='" & Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("003", GridStr(), Szzls))) & "'"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
- If Not RecTemp.EOF Then
- LrText(0).Text = Trim(RecTemp.Fields("Ccode")) '科目编码
- LrText(5).Text = Trim(RecTemp.Fields("AssCode") & "") '助记码
- LrText(1).Text = Trim(RecTemp.Fields("Cname") & "") '科目名称
- Combo_Class.Text = Trim(RecTemp.Fields("CClass")) '科目类型
- Combo_Prop.Text = Trim(RecTemp.Fields("CProperty")) '科目性质
- Combo_AccFormat = Trim(RecTemp.Fields("AccFormat")) '帐页格式
- If RecTemp.Fields("ForeignFlag") Then
- Chk_ForiFlag.Value = 1 '外币核算标志
- LrText(2).Text = Trim(RecTemp.Fields("ForeignCurrName") & "")
- LrText(2).Tag = Trim(RecTemp.Fields("ForeignCurrCode") & "")
- Call Textyx(LrText(2))
- Ydcommand1(2).Enabled = True
- Else
- Chk_ForiFlag.Value = 0
- LrText(2).Text = ""
- LrText(2).Tag = ""
- Call Textwx(LrText(2))
- Ydcommand1(2).Enabled = False
- End If
- If RecTemp.Fields("QuantityFlag") Then
- Chk_QuatFlag.Value = 1 '数量核算标志
- LrText(3).Text = Trim(RecTemp.Fields("Measure") & "")
- Call Textyx(LrText(3))
- Else
- Chk_QuatFlag.Value = 0
- Call Textwx(LrText(3))
- LrText(3).Text = ""
- End If
- If RecTemp.Fields("IIFSum") Then
- Chk_SumPrint.Value = 1 '汇总打印
- LrText(6).Text = Trim(RecTemp.Fields("cSumCode") & "")
- Call Textyx(LrText(6))
- Else
- Chk_SumPrint.Value = 0
- Call Textwx(LrText(6))
- LrText(6).Text = ""
- End If
- If Trim(RecTemp.Fields("BalanceOri")) = "借" Then '余额方向
- Opt_Yefx(0).Value = True
- Else
- Opt_Yefx(1).Value = True
- End If
- If RecTemp.Fields("CusFlag") Then
- Chk_Ass(0).Value = 1 '辅助核算(客户)
- Else
- Chk_Ass(0).Value = 0
- End If
- If RecTemp.Fields("SupplierFlag") Then
- Chk_Ass(4).Value = 1 '辅助核算(供应商)
- Else
- Chk_Ass(4).Value = 0
- End If
- If RecTemp.Fields("DeptFlag") Then
- Chk_Ass(1).Value = 1 '辅助核算(部门)
- Else
- Chk_Ass(1).Value = 0
- End If
- If RecTemp.Fields("PersonFlag") Then
- Chk_Ass(2).Value = 1 '辅助核算(个人)
- Else
- Chk_Ass(2).Value = 0
- End If
- If RecTemp.Fields("ItemFlag") Then '辅助核算(项目)
- Chk_Ass(3).Value = 1
- LrText(4).Text = Trim(RecTemp.Fields("ItemClassName") & "")
- LrText(4).Tag = Trim(RecTemp.Fields("ItemClassCode") & "")
- Call Textyx(LrText(4))
- Ydcommand1(4).Enabled = True
- Else
- Chk_Ass(3).Value = 0
- LrText(4).Text = ""
- LrText(4).Tag = ""
- Call Textwx(LrText(4))
- Ydcommand1(4).Enabled = False
- End If
- If RecTemp.Fields("DayBookFlag") Then '日记帐
- Chk_DayBookFlag.Value = 1
- Else
- Chk_DayBookFlag.Value = 0
- End If
- If RecTemp.Fields("CashFlowFlag") Then '现金或现金等价物
- Chk_CashFlow.Value = 1
- Else
- Chk_CashFlow.Value = 0
- End If
- If RecTemp.Fields("StopFlag") Then '停用
- ChkStopUse.Value = 1
- Else
- ChkStopUse.Value = 0
- End If
- If RecTemp.Fields("EndFlag") Then '停用是否有效
- ChkStopUse.Enabled = True
- Else
- ChkStopUse.Enabled = False
- End If
- Else
- Tsxx = "该科目已经被其他人删除,请刷新当前数据!"
- Call Xtxxts(Tsxx, 0, 4)
- Call Cancel
- TextChangeLock = False
- Exit Function
- End If
- End If
- Cshlrxx = True
- TextChangeLock = False
- End Function
- Private Sub Scdqjl() '删 除 当 前 记 录
- Dim Str_Parent As String
- Dim yhAnswer As Integer
- '非数据行不能删除
- If CzxsGrid.Row < CzxsGrid.FixedRows Then
- Exit Sub
- End If
- '用户确认是否删除记录
- Tsxx = "请确认是否删除当前记录?"
- yhAnswer = Xtxxts(Tsxx, 2, 2)
- If yhAnswer = 2 Then
- Exit Sub
- End If
- '判断此科目是否存在下级科目,如存在则提示不能删除
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute("Select Ccode From Cwzz_AccCode Where ParentCode='" & Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("003", GridStr(), Szzls))) & "'")
- If Not RecTemp.EOF Then
- Tsxx = "此科目存在下级科目,不能删除!"
- Call Xtxxts(Tsxx, 0, 1)
- Exit Sub
- End If
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute("Select ParentCode From Cwzz_AccCode Where CCode='" & Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("003", GridStr(), Szzls))) & "'")
- If Not RecTemp.EOF Then
- Str_Parent = Trim(RecTemp.Fields("ParentCode") & "")
- End If
- On Error GoTo Cwcl
- Cw_DataEnvi.DataConnect.BeginTrans
- '[以下需自定义部分
- Cw_DataEnvi.DataConnect.Execute "delete Cwzz_AccCode where CCode = '" + Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("003", GridStr(), Szzls))) + "'"
- '依情况修改上级科目末级标志
- If Str_Parent <> "" Then
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute("Select Ccode From Cwzz_AccCode Where ParentCode='" & Str_Parent & "'")
- If RecTemp.EOF Then
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute("Update Cwzz_AccCode Set Endflag=1 Where Ccode='" & Trim(Str_Parent) & "'")
- End If
- End If
- '以上为自定义部分]
- Cw_DataEnvi.DataConnect.CommitTrans
- CzxsGrid.RemoveItem CzxsGrid.Row
- Exit Sub
- Cwcl:
- Cw_DataEnvi.DataConnect.RollbackTrans
- If Err.Number = -2147217873 Then '(-2147217873 为SQL Server 2000通过建立外键产生的错误号)
- Tsxx = "该编码已经被使用,不能删除!"
- Call Xtxxts(Tsxx, 0, 1)
- Exit Sub
- Else
- Tsxx = "出现未知情况,该编码不能被删除!"
- Call Xtxxts(Tsxx, 0, 1)
- Exit Sub
- End If
- End Sub
- '*******************以下区域为编写自定义过程区域**********************
- Private Sub Chk_ForiFlag_Click() '单击外币核算标志
- If Chk_ForiFlag.Value = 1 Then
- Call Textyx(LrText(2))
- Ydcommand1(2).Enabled = True
- Else
- Call Textwx(LrText(2))
- Ydcommand1(2).Enabled = False
- End If
- End Sub
- Private Sub Chk_QuatFlag_Click() '单击数量核算标志
- If Chk_QuatFlag.Value = 1 Then
- Call Textyx(LrText(3))
- Else
- Call Textwx(LrText(3))
- End If
- End Sub
- Private Sub Chk_SumPrint_Click() '单击汇总打印
- If Chk_SumPrint.Value = 1 Then
- Call Textyx(LrText(6))
- Else
- Call Textwx(LrText(6))
- End If
- End Sub
- Private Sub Chk_Ass_Click(Index As Integer) '单击项目核算标志
- If Chk_Ass(3).Value = 1 Then
- Call Textyx(LrText(4))
- Ydcommand1(4).Enabled = True
- Else
- Call Textwx(LrText(4))
- Ydcommand1(4).Enabled = False
- End If
- Select Case Index
- Case 0 '客户往来
- If Chk_Ass(Index).Value = 1 Then
- Chk_Ass(2).Enabled = False
- Chk_Ass(4).Enabled = False
- If Chk_Ass(3).Value = 1 Then
- Chk_Ass(1).Enabled = False
- End If
- If Chk_Ass(1).Value = 1 Then
- Chk_Ass(3).Enabled = False
- End If
- Else
- If Chk_Ass(3).Value <> 1 And Chk_Ass(4).Value <> 1 Then
- Chk_Ass(2).Enabled = True
- End If
- Chk_Ass(1).Enabled = True
- Chk_Ass(3).Enabled = True
- Chk_Ass(4).Enabled = True
- End If
- Case 1 '部门核算
- If Chk_Ass(Index).Value = 1 Then
- If Chk_Ass(3).Value = 1 Then
- Chk_Ass(0).Enabled = False
- Chk_Ass(4).Enabled = False
- End If
- If Chk_Ass(0).Value = 1 Then
- Chk_Ass(3).Enabled = False
- Chk_Ass(4).Enabled = False
- End If
- If Chk_Ass(4).Value = 1 Then
- Chk_Ass(0).Enabled = False
- Chk_Ass(3).Enabled = False
- End If
- Else
- If Chk_Ass(0).Value <> 1 And Chk_Ass(3).Value <> 1 And Chk_Ass(4).Value <> 1 Then
- Chk_Ass(2).Enabled = True
- End If
- Chk_Ass(3).Enabled = True
- If Chk_Ass(0).Value <> 1 Then
- Chk_Ass(4).Enabled = True
- End If
- If Chk_Ass(4).Value <> 1 Then
- Chk_Ass(0).Enabled = True
- End If
- End If
- Case 2 '个人往来
- If Chk_Ass(Index).Value = 1 Then
- Chk_Ass(0).Enabled = False
- Chk_Ass(3).Enabled = False
- Chk_Ass(4).Enabled = False
- Else
- Chk_Ass(0).Enabled = True
- Chk_Ass(3).Enabled = True
- Chk_Ass(4).Enabled = True
- End If
- Case 3 '项目核算
- If Chk_Ass(Index).Value = 1 Then
- Chk_Ass(2).Enabled = False
- If Chk_Ass(1).Value = 1 Then
- Chk_Ass(0).Enabled = False
- Chk_Ass(4).Enabled = False
- End If
- If Chk_Ass(0).Value = 1 Then
- Chk_Ass(1).Enabled = False
- Chk_Ass(4).Enabled = False
- End If
- If Chk_Ass(4).Value = 1 Then
- Chk_Ass(0).Enabled = False
- Chk_Ass(1).Enabled = False
- End If
- Else
- If Chk_Ass(0).Value <> 1 And Chk_Ass(4).Value <> 1 Then
- Chk_Ass(2).Enabled = True
- End If
- Chk_Ass(1).Enabled = True
- If Chk_Ass(0).Value <> 1 Then
- Chk_Ass(4).Enabled = True
- End If
- If Chk_Ass(4).Value <> 1 Then
- Chk_Ass(0).Enabled = True
- End If
- End If
- Case 4 '供应商往来
- If Chk_Ass(Index).Value = 1 Then
- Chk_Ass(2).Enabled = False
- Chk_Ass(0).Enabled = False
- If Chk_Ass(3).Value = 1 Then
- Chk_Ass(1).Enabled = False
- End If
- If Chk_Ass(1).Value = 1 Then
- Chk_Ass(3).Enabled = False
- End If
- Else
- If Chk_Ass(3).Value <> 1 And Chk_Ass(0).Value <> 1 Then
- Chk_Ass(2).Enabled = True
- End If
- Chk_Ass(1).Enabled = True
- Chk_Ass(3).Enabled = True
- Chk_Ass(0).Enabled = True
- End If
- End Select
- End Sub
- Private Sub Combo_Class_Change() '根据类型改变余额方向
- If Combo_Class.ListIndex = 0 Or Combo_Class.ListIndex = 3 Then '资产类和成本类余额方向一般为借方
- Opt_Yefx(0).Value = True
- Else
- Opt_Yefx(1).Value = True
- End If
- End Sub
- '*******************以上区域为编写自定义过程区域**********************
- '*******************************以下为基本处理程序(固定不变)*******************************************'
- Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer) '支持热键操作
- If Shift = 2 Then
- Select Case UCase(Chr(KeyCode))
- Case "P" 'Ctrl+P 打印
- If SzToolbar.Buttons("dy").Visible And SzToolbar.Buttons("dy").Enabled Then
- Call bbyl(False)
- End If
- Case "A" 'Ctrl+A 增加
- If SzToolbar.Buttons("zj").Visible And SzToolbar.Buttons("zj").Enabled Then
- Call Toolbjzt
- Lrzt = 1
- Call Cshlrxx(Lrzt)
- LrText(0).SetFocus
- LrText(0).Locked = False
- End If
- Case "D" 'Ctrl+D 删除
- If SzToolbar.Buttons("sc").Visible And SzToolbar.Buttons("sc").Enabled Then
- Call Scdqjl
- End If
- End Select
- End If
- End Sub
- Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
- Select Case Button.Key
- Case "ymsz" '页面设置
- Dyymctbl.Show 1
- Case "yl" '预 览
- Call bbyl(True)
- Case "dy" '打 印
- Call bbyl(False)
- Case "zj" '增 加
- Call Toolbjzt
- Lrzt = 1
- Call Cshlrxx(Lrzt)
- LrText(0).SetFocus
- LrText(0).Locked = False
- Case "dw" '定 位
- JC_FrmKmdw.Show 1
- If Xtfhcs <> "" Then
- With CzxsGrid
- For jsqte = .FixedRows To .Rows - 1
- If Mid(.TextMatrix(jsqte, Sydz("003", GridStr(), Szzls)), 1, Len(Xtfhcs)) = Xtfhcs Then
- .Select jsqte, Sydz("003", GridStr(), Szzls)
- .TopRow = jsqte
- Exit For
- End If
- Next jsqte
- End With
- End If
- Case "xg" '修 改
- Call Xgdqjl
- Case "sc" '删 除
- Call Scdqjl
- Case "sx" '刷 新
- Call Cxnrtcwg
- Case "bz" '帮 助
- Call F1bz
- Case "fh" '退 出
- Unload Me
- End Select
- End Sub
- Private Sub CzxsGrid_DblClick() '修改当前编码记录
- Call Xgdqjl
- End Sub
- Private Sub Xgdqjl() '修改当前编码记录
- If CzxsGrid.Row < CzxsGrid.FixedRows Then
- Exit Sub
- End If
- Call Toolbjzt
- Lrzt = 2
- If Cshlrxx(Lrzt) Then
- LrText(1).SetFocus
- LrText(0).Locked = True
- End If
- End Sub
- Private Sub Toolbjzt() 'Toolbar状态(编辑状态)
- StTab.TabEnabled(1) = True
- StTab.Tab = 1
- Frame1.Enabled = True
- StTab.TabEnabled(0) = False
- CzxsGrid.Enabled = False
- With SzToolbar
- .Buttons("ymsz").Enabled = False
- .Buttons("dy").Enabled = False
- .Buttons("yl").Enabled = False
- .Buttons("zj").Enabled = False
- .Buttons("xg").Enabled = False
- .Buttons("sc").Enabled = False
- .Buttons("sx").Enabled = False
- .Buttons("dw").Enabled = False
- End With
- End Sub
- Private Sub Toolfbjzt() 'Toolbar状态(非编辑状态)
- StTab.TabEnabled(0) = True
- StTab.Tab = 0
- CzxsGrid.Enabled = True
- Frame1.Enabled = False
- StTab.TabEnabled(1) = False
- Lrzt = 0
- With SzToolbar
- .Buttons("ymsz").Enabled = True
- .Buttons("dy").Enabled = True
- .Buttons("yl").Enabled = True
- .Buttons("zj").Enabled = True
- .Buttons("xg").Enabled = True
- .Buttons("sc").Enabled = True
- .Buttons("sx").Enabled = True
- .Buttons("dw").Enabled = True
- End With
- End Sub
- Private Sub BcCommand_Click() '保 存
- If Not Bclrsj Then
- Exit Sub
- End If
- If Lrzt = 2 Then
- Call Toolfbjzt
- End If
- End Sub
- Private Sub QxCommand_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) '取消
- '避免执行Click程序
- Bln_Cancel = True
- Call Cancel
- End Sub
- Private Sub QxCommand_Click() '取消
- If Bln_Cancel Then
- Bln_Cancel = False
- Exit Sub
- End If
- Call Cancel
- End Sub
- Private Sub Cancel() '取消
- '文本框加锁
- For jsqte = 0 To Max_Text_Index
- TextValiJudgeLock(jsqte) = True
- Next jsqte
- Call Toolfbjzt
- End Sub
- Private Sub CzxsGrid_BeforeMoveColumn(ByVal Col As Long, Position As Long) '网格列发生移动时自动交换网格索引信息
- Call FnBln_RefreshArray(Col, Position, GridStr(), GridInf())
- End Sub
- Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button) '表格格式设置(通用)
- Select Case Button.Key
- Case "bcgs" '保存表格格式
- Call Bcwggs(CzxsGrid, GridCode, GridStr())
- Case "hfmrgs" '恢复默认格式
- Call Hfmrgs(CzxsGrid, GridCode, GridStr())
- Case "szxsxm" '设置显示项目
- Call Szxsxm(CzxsGrid, GridCode)
- 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 = 0 '报 表 表 尾 行 数
- 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
- Bbxbt(1) = " "
- bbxbtzzxs(1) = 0 '报表行组织形式(0-居左 1-居中 2-居右)
- Call Scyxsjb(CzxsGrid) '生成报表数据
- Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
- If Not bbylte Then
- Unload DY_Tybbyldy
- End If
- End Sub
- '************以下为文本框录入处理程序(固定不变部分)*************'
- Private Sub Wbklrwbcl(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, 11 '金额型
- Call Sjgskz(LrText(Index), Xtjezws - Xtjexsws - 1, Xtjexsws)
- Case 9, 12 '数量型
- 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
- '自动调入上级科目科目名称
- Select Case Index
- Case 0
- For jsqte = 1 To Int_CodeLev
- If Int_CodeScheme(jsqte) = Len(Trim(LrText(0).Text)) Then
- CodeLev = jsqte
- Exit For
- End If
- Next jsqte
- If jsqte <= CodeLev Then
- If jsqte > 1 Then
- Str_Parent = Mid(Trim(LrText(0).Text), 1, Int_CodeScheme(jsqte - 1))
- Else
- Str_Parent = ""
- End If
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute("SELECT CCode,Cname FROM Cwzz_AccCode Where CCode='" & Trim(Str_Parent) & "'")
- If Not RecTemp.EOF Then
- LrText(1).Text = Trim(RecTemp.Fields("Cname")) + "/"
- End If
- Else
- LrText(1).Text = ""
- End If
- If Val(Mid(LrText(0).Text, 1)) <= 5 And Val(Mid(LrText(0).Text, 1)) >= 1 Then
- Combo_Class.Text = Combo_Class.List(Val(Mid(LrText(0).Text, 1)) - 1)
- 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) '文本框失去焦点
- '显示相应信息但不能进行有效性判断
- End Sub
- Private Sub Ydcommand1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single) '按钮提供帮助
- Call Text_Help(Index)
- End Sub
- Private Sub Text_Help(Index As Integer) '录入字段帮助
- If Not Textboolean(Index, 1) 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
- LrText(Index).SetFocus
- End Sub
- Private Sub TextShow(Index As Integer) '文本框得到焦点,显示相应信息
- '填写文本框得到焦点,进行相应信息处理程序
- End Sub
- Private Sub Wbkcsh() '录入文本框初始化
- Dim jsqte As Integer
- '最大录入文本框索引值
- 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
- If Textboolean(jsqte, 1) Then
- If jsqte <> 0 And Not Textboolean(jsqte, 3) Then
- Load Ydcommand1(jsqte)
- End If
- Ydcommand1(jsqte).Visible = True
- Ydcommand1(jsqte).Move LrText(jsqte).Left + LrText(jsqte).Width, LrText(jsqte).Top
- End If
- 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 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
- '文本框内容为空认为有效,并清空其Tag值
- If Trim(LrText(Index)) = "" Then
- LrText(Index).Tag = ""
- Call Wbklrwbcl(Index)
- TextValiJudgeLock(Index) = True
- TextYxxpd = True
- Exit Function
- End If
- '可在此加入不做有效性判断的理由
- '1.外币核算
- If Index = 2 Then
- If Chk_ForiFlag.Value = 0 Then
- TextYxxpd = True
- Exit Function
- End If
- End If
- '2.项目核算
- If Index = 4 Then
- If Chk_Ass(3).Value = 0 Then
- TextYxxpd = True
- Exit Function
- End If
- 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")
- If Val(Mid(LrText(Index), 1, 4)) < 1900 Then
- LrText(Index).Text = "1900" + Mid(LrText(Index), 5, 6)
- End If
- Else
- Tsxx = "非法公历日期!(格式:" + Format(Date, "yyyy-mm-dd") + ")"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(Index).SetFocus
- Exit Function
- End If
- Case 3 '其他类型
- End Select
- '如果有效则加锁,用户不改变内容则不再进行有效性判断
- TextValiJudgeLock(Index) = True
- '调用文本框事后处理程序
- Call Wbklrwbcl(Index)
- '有效性判断通过则返回True
- TextYxxpd = True
- End Function