Foxtable(狐表)用户栏目专家坐堂 → [求助]统计表达式不计算


  共有2638人关注过本帖树形打印复制链接

主题:[求助]统计表达式不计算

帅哥哟,离线,有人找我吗?
方丈
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:811 积分:10970 威望:0 精华:1 注册:2008/9/2 18:58:00
[求助]统计表达式不计算  发帖心情 Post By:2018/5/24 9:01:00 [只看该作者]

请教,下面的代码为什么没反应?错在哪儿?

SystemReady = False
Try

For Each dr1 As DataRow In DataTables("评价表").Select("")
    dr1("评价总积分") = 0
Next     '
            Dim Y1 As Single =e.Form.Controls("NumericComboBox1").value
            Dim H1 As Single =e.Form.Controls("NumericComboBox2").value
            Dim B1 As Single =e.Form.Controls("NumericComboBox3").value
            
            Dim Y2 As Single =e.Form.Controls("NumericComboBox4").value
            Dim H2 As Single =e.Form.Controls("NumericComboBox5").value
            Dim B2 As Single =e.Form.Controls("NumericComboBox6").value
            
            Dim Y3 As Single =e.Form.Controls("NumericComboBox7").value
            Dim H3 As Single =e.Form.Controls("NumericComboBox8").value
            Dim B3 As Single =e.Form.Controls("NumericComboBox9").value
            
            Dim Y4 As Single =e.Form.Controls("NumericComboBox10").value
            Dim H4 As Single =e.Form.Controls("NumericComboBox01").value
            Dim B4 As Single =e.Form.Controls("NumericComboBox02").value
            
            

 Dim dt As Table = Tables("评价表")  
    For m As Integer = 0 To dt.rows.count -1
     Dim jf As Single = 0    
        For n As Integer = 1 To 4  
              
            If dt.Rows(m)("评委" & n) = "优秀" Then
                jf  = Y & n    
            Else If dt.Rows(m)("评委" & n) = "不合格"
                jf = B & n
            Else If dt.Rows(m)("评委" & n) = "合格"
                jf  = H & n 
            End If
 dt.Rows(m)("评价总积分") = dt.Rows(m)("评价总积分") + jf  
       Next   

    Next
Catch ex As Exception
    MessageBox.Show("评价积分统计完成!")
End Try
SystemReady = True

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/5/24 9:14:00 [只看该作者]

与其这样,你还不如给 NumericComboBox 命名为 y1、y2、y3 这样的名称呢,然后直接用,如

 


For Each dr1 As DataRow In DataTables("评价表").Select("")
    dr1("评价总积分") = 0
Next     '
Dim dt As Table = Tables("评价表")
For m As Integer = 0 To dt.rows.count -1
    Dim jf As Single = 0
    For n As Integer = 1 To 4
       
        If dt.Rows(m)("评委" & n) = "优秀" Then
            jf  = e.form.controls("Y" & n).Value
        Else If dt.Rows(m)("评委" & n) = "不合格"
            jf = e.form.controls("B" & n).Value
        Else If dt.Rows(m)("评委" & n) = "合格"
            jf  = e.form.controls("H" & n).Value
        End If
        dt.Rows(m)("评价总积分") = dt.Rows(m)("评价总积分") + jf
    Next       
Next


 回到顶部