office交流網--QQ交流群號

Access培訓群:792054000         Excel免費交流群群:686050929          Outlook交流群:221378704    

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

test vba

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