' Debug.Print i & "调用后------------"; Format(Now, "yyyy-mm-dd hh:mm:ss:ms")
' If Len(strShipCode) <> 0 And Len(strFeeCode) <> 0 Then ' ' strKey = "S" & strShipCode & "F" & strFeeCode ''颠倒这个key,下半截就出来了 ' ' End If Select Case intCompare
Case 0 ''正常的恢复其本来的颜色
Tvw.Nodes(i).ForeColor = vbBlack
' Tvw.Nodes(strKey).ForeColor = vbBlack
Case 1 Tvw.Nodes(i).ForeColor = vbBlue ''总费用不超而某个月超了的
' Tvw.Nodes(strKey).ForeColor = vbBlue Case 2 Tvw.Nodes(i).ForeColor = vbRed ''总费用也超了的
' Tvw.Nodes(strKey).ForeColor = vbRed End Select
If intCompare > 0 Then
If Tvw.Nodes(i).Children > 0 Then
Tvw.Nodes(i).EnsureVisible
End If
End If Next
写一个函数,比如 Sub BindGrid(oGrid as Object,byval SQL as String)
写一个函数,比如 Sub BindGrid(oGrid as Object,byval SQL as String) dim rs as New RecordSet ShowHint "正在处理数据请稍候... ..." '显示提示过程 DoEvents Rs.open sql,cn,1,1 Set oGrid.RecordSource=Rs Set Rs=Nothing HideHint '消失提示过程 End Sub
strKey = Tvw.Nodes(i).key
'=========================================================================
'修改人:wild 日期:2004年07月29日
'说 明:不可这样,是不对称的,只能遍历每个节点
'-------------------------------------------------------------------------
'=========================================================================
' If Left(strKey, 1) = "F" Then ''只遍历上半截,下半截是对称的
FrmSlash.Label1.Caption = cTip & vbNewLine & "正在计算:" & Tvw.Nodes(i).Text & "费用超标情况…………"
FrmSlash.Refresh''关键在这里,或者改成 doevents 就可以了
GetStatisticWay strKey, strShipCode, strFeeCode, strTitle
' Debug.Print i & "调用前------------"; Format(Now, "yyyy-mm-dd hh:mm:ss:ms")
intCompare = CompareFee(mstrYear, strShipCode, strFeeCode, strNotFee, Me.CboSWay.ListIndex, , , intmonth)
' Debug.Print i & "调用后------------"; Format(Now, "yyyy-mm-dd hh:mm:ss:ms")
' If Len(strShipCode) <> 0 And Len(strFeeCode) <> 0 Then
'
' strKey = "S" & strShipCode & "F" & strFeeCode ''颠倒这个key,下半截就出来了
'
' End If Select Case intCompare
Case 0 ''正常的恢复其本来的颜色
Tvw.Nodes(i).ForeColor = vbBlack
' Tvw.Nodes(strKey).ForeColor = vbBlack
Case 1 Tvw.Nodes(i).ForeColor = vbBlue ''总费用不超而某个月超了的
' Tvw.Nodes(strKey).ForeColor = vbBlue Case 2 Tvw.Nodes(i).ForeColor = vbRed ''总费用也超了的
' Tvw.Nodes(strKey).ForeColor = vbRed End Select
If intCompare > 0 Then
If Tvw.Nodes(i).Children > 0 Then
Tvw.Nodes(i).EnsureVisible
End If
End If
Next
Sub BindGrid(oGrid as Object,byval SQL as String)
Sub BindGrid(oGrid as Object,byval SQL as String)
dim rs as New RecordSet
ShowHint "正在处理数据请稍候... ..." '显示提示过程
DoEvents
Rs.open sql,cn,1,1
Set oGrid.RecordSource=Rs
Set Rs=Nothing
HideHint '消失提示过程
End Sub