test vba

2017-07-01 22:17:00
zstmtony
原创
282
摘要: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
分享