office交流网--QQ交流群号

Access培训群:792054000         Excel免费交流群群:686050929          Outlook交流群:221378704    

Word交流群:218156588             PPT交流群:324131555

test vba

2017-07-01 22:17:00
zstmtony
原创
3009
摘要:VBA 测试代码 未测试完全
Private Sub Form_Load()
 
 If fraType.Value = 1 Then
  
    '增加一个设置是否可多选的项,节点checked=true
    mintType = 0
    mstrId = 1
    mstrSql = "SELECT * FROM met_column where lang='cn' ORDER BY bigclass,[name] " 'gf_Nz(gf_GetParaItem("Sql", Me.OpenArgs))
    mstrParentFld = "bigclass"
    mstrIdFld = "id"
    mstrTitleFld = "name"
    mstrCheckBox = 1
    'Me.trvType.SingleSel = True
    LoadTree
    If mstrId <> "" And mstrId <> "0" And mintType = 1 Then
        On Error Resume Next '当相关项与 当前类别 是父子关系时,会提示出错 以后再改进
        Me.trvType.Nodes.Remove mstrId
    Else
      If mstrCheckBox <> "1" Then GotoNode "fo_" & mstrId
    End If
Else
    '增加一个设置是否可多选的项,节点checked=true
    mintType = 0
    mstrId = 1
    mstrSql = "SELECT * FROM eps_category ORDER BY parent,[order] "
    mstrParentFld = "parent"
    mstrIdFld = "id"
    mstrTitleFld = "name"
    mstrCheckBox = 1
    'Me.trvType.SingleSel = True
    LoadTree
    If mstrId <> "" And mstrId <> "0" And mintType = 1 Then
        On Error Resume Next '当相关项与 当前类别 是父子关系时,会提示出错 以后再改进
        Me.trvType.Nodes.Remove mstrId
    Else
      If mstrCheckBox <> "1" Then GotoNode "fo_" & mstrId
    End If
End If
 
    Me.trvType.FullRowSelect = True
'    Me.trvType.HideSelection = False
'    Me.trvType.HotTracking = True
     Me.trvType.LabelEdit = 0
       wbMessage.Navigate "about:blank"

End Sub
分享