请高手帮忙优化下代码。如图要统计状态例的不同状态的记录数。显示在RibbonMenu.StatusBar.Message1 。如果有的话显示。没有的不用显示。
此主题相关图片如下:2013-06-16_14-53-53.jpg
Dim f1,f2,f3 ,f4,f5,f6,f7,f8,f9 As String
f1 = "状态 = '接单'"
f2 = "状态 = '已派车'"
f3 = "状态 = '作业中'"
f4 = "状态 = '待收单'"
f5 = "状态 = '待结账'"
f6 = "状态 = '正结费'"
f7 = "状态 = '待确认'"
f8 = "状态 = '待审核'"
f9 = "状态 = '已审核'"
Dim c1 As Integer = Tables("业务大表").Compute("Count([_Identify])",f1)
Dim c2 As Integer = Tables("业务大表").Compute("Count([_Identify])",f2)
Dim c3 As Integer = Tables("业务大表").Compute("Count([_Identify])",f3)
Dim c4 As Integer = Tables("业务大表").Compute("Count([_Identify])",f4)
Dim c5 As Integer = Tables("业务大表").Compute("Count([_Identify])",f5)
Dim c6 As Integer = Tables("业务大表").Compute("Count([_Identify])",f6)
Dim c7 As Integer = Tables("业务大表").Compute("Count([_Identify])",f7)
Dim c8 As Integer = Tables("业务大表").Compute("Count([_Identify])",f8)
Dim c9 As Integer = Tables("业务大表").Compute("Count([_Identify])",f9)
RibbonMenu.StatusBar.Message1 = "接单:" & c1 & " 已派车:" & c2 & " 作业中:" & c3 & " 待收单:" & c4 & " 待结账:" & c5 & " 正结费:" & c6 & " 待确认:" & c7 & " 待审核:" & c8 & " 已审核:" & c9