📄
字号:
VERSION 5.00
Object = "{BEEECC20-4D5F-4F8B-BFDC-5D9B6FBDE09D}#1.0#0"; "vsflex8.ocx"
Begin VB.Form Ed_EmpArInfoCorHlp
BorderStyle = 1 'Fixed Single
ClientHeight = 5235
ClientLeft = 2550
ClientTop = 1230
ClientWidth = 5535
Icon = "辅助_相关项目帮助.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5235
ScaleWidth = 5535
Begin VSFlex8Ctl.VSFlexGrid CzxsGrid
Height = 4215
Left = 75
TabIndex = 7
Top = 450
Width = 5340
_cx = 9419
_cy = 7435
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 = -2147483636
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 = 50
Cols = 10
FixedRows = 1
FixedCols = 1
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.CommandButton QdCommand
Caption = "确定(&O)"
Height = 300
Left = 2820
TabIndex = 5
Top = 4770
Width = 795
End
Begin VB.CommandButton QxCommand
Cancel = -1 'True
Caption = "取消(&C)"
Height = 300
Left = 3720
TabIndex = 4
Top = 4770
Width = 795
End
Begin VB.CommandButton Bjcommand
Caption = "编辑(&E)"
Enabled = 0 'False
Height = 300
Left = 4650
TabIndex = 3
Top = 4770
Width = 795
End
Begin VB.TextBox CodeText
Height = 300
Left = 1080
TabIndex = 2
Top = 45
Width = 4410
End
Begin VB.CommandButton Gridsz
Caption = "保存表格格式"
Enabled = 0 'False
Height = 300
Index = 0
Left = 60
TabIndex = 1
Top = 4770
Width = 1335
End
Begin VB.CommandButton Gridsz
Caption = "恢复默认格式"
Enabled = 0 'False
Height = 300
Index = 1
Left = 1410
TabIndex = 0
Top = 4770
Width = 1335
End
Begin VB.Label Label1
BackColor = &H00C0C0C0&
BackStyle = 0 'Transparent
Caption = "编码或名称"
Height = 255
Index = 0
Left = 120
TabIndex = 6
Top = 68
Width = 975
End
End
Attribute VB_Name = "Ed_EmpArInfoCorHlp"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim emp_id() As Integer
Dim lstId() As Integer
Private Sub CodeText_Change()
On Error Resume Next
Dim i As Integer
With CzxsGrid
For i = 1 To .Rows - 1
If .TextMatrix(i, 0) Like CodeText & "*" Or .TextMatrix(i, 1) Like Trim(CodeText) & "*" Then
.Row = i
.SetFocus
SendKeys "{LEFT}", True
CodeText.SetFocus
Exit For
End If
Next
End With
End Sub
Private Sub CzxsGrid_DblClick()
With CzxsGrid
If .Rows <> 1 Then
If Trim(SsqlHelp) = "Emp" Then
P_Code = .TextMatrix(.Row, 0)
Else
P_Code = lstId(.Row)
End If
P_Name = .TextMatrix(.Row, 1)
Xtfhcs = emp_id(.Row)
End If
End With
Unload Me
End Sub
Private Sub czxsgrid_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then CzxsGrid_DblClick
End Sub
Private Sub Form_Activate()
CzxsGrid.SetFocus
SendKeys "{LEFT}", True
End Sub
Private Sub Form_Load()
Dim tmpSql As String
P_Code = ""
P_Name = ""
Dim aDo_Help As New Recordset: Dim aDo_Item As New Recordset
Dim sSql As String: Dim i As Integer
Select Case Trim(SsqlHelp)
Case "Emp"
sSql = "SELECT EmpId,EmpNo,EmpName FROM Rs_BasicInfo WHERE EmpId <> -1 AND YNStop <> 1 ORDER BY EmpNo " '??? ynstop
Case Else
'-------------------------
tmpSql = "SELECT * FROM Rs_Items WHERE itemId=" & SsqlHelp
Set aDo_Item = Cw_DataEnvi.DataConnect.Execute(tmpSql)
If Trim(aDo_Item!CorTable) = "Rs_CorSub" Then 'SsqlHelp 1
sSql = "SELECT * FROM Rs_CorMain m,Rs_CorSub s WHERE " _
& "m.SortId=s.SortId AND s.SortId='" & Trim(aDo_Item!Correlation) & "'AND S.ynstop='0' order by s.ListId"
Else ' 2
sSql = "select * from " & aDo_Item!CorTable
End If
End Select
Set aDo_Help = Cw_DataEnvi.DataConnect.Execute(sSql)
' 设置编码对照窗体的Caption
If Not aDo_Help.EOF Then
Select Case Trim(SsqlHelp)
Case "Emp"
Me.Caption = "人员选择"
Case Else
If Trim(aDo_Item!CorTable) = "Rs_CorSub" Then '执行上面 1
Me.Caption = Trim(aDo_Help.Fields("SortName"))
Else
If Trim(aDo_Item!CorTable) = "Gy_Department" Then Me.Caption = "部门"
End If
End Select
End If
' 填充网格
i = 1
With CzxsGrid
.Rows = aDo_Help.RecordCount + 1
ReDim emp_id(1 To .Rows)
ReDim lstId(1 To .Rows)
Do While Not aDo_Help.EOF
Select Case Trim(SsqlHelp)
Case "Emp"
'<<<<<<<<<<<<<<<<<<<<<<<
.TextMatrix(i, 0) = Trim(aDo_Help!EmpNo)
.TextMatrix(i, 1) = "" & Trim(aDo_Help!EmpName)
emp_id(i) = aDo_Help.Fields("EmpId")
Case Else
If Trim(aDo_Item!CorTable) = "Rs_CorSub" Then
lstId(i) = Trim(aDo_Help!ListID)
.TextMatrix(i, 0) = Val(Mid(CStr(Trim(aDo_Help!ListID)), Len(Trim(aDo_Help!ListID)) - 3 + 1, 3))
.TextMatrix(i, 1) = aDo_Help!ListName
Else
.TextMatrix(i, 0) = Trim(aDo_Help(Trim(aDo_Item!IndexCode)))
.TextMatrix(i, 1) = Trim(aDo_Help(Trim(aDo_Item!IndexName)))
End If
End Select
i = i + 1
aDo_Help.MoveNext
Loop
End With
If aDo_Item.State = 1 Then
aDo_Item.Close
Set aDo_Item = Nothing
End If
aDo_Help.Close
CodeText.Text = YesNo_str
End Sub
Private Sub QdCommand_Click()
CzxsGrid_DblClick
End Sub
Private Sub QxCommand_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -