Foxtable(狐表)用户栏目专家坐堂 → [求助]窗口中的数据平均分配


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

主题:[求助]窗口中的数据平均分配

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


加好友 发短信 F6
等级:狐精 帖子:3036 积分:19223 威望:0 精华:2 注册:2008/9/1 7:50:00
  发帖心情 Post By:2017/2/16 17:44:00 [显示全部帖子]

当然可以实现了,参考代码:
Dim sz As Double = e.form.controls("录入数据").Value
Dim r As Row = Tables("XXX").Current
If sz <> 0 And r IsNot Nothing
    Dim n As Integer = 0
    Dim pjs As String
    For i As Integer = 1 To 4
        Dim kj As String = "RadioButton"+Cstr(i)
        If  e.Form.Controls(kj).Checked = True
            n = n +1
            If pjs > ""
                pjs = pjs + "|" + e.Form.Controls(kj).Text
            Else
                pjs = e.Form.Controls(kj).Text
            End If
        End If
    Next
   
    If n > 0
        Dim m As Double = sz/n
        For Each   pj As String In pjs.Split("|")
            r(pj) = r(pj) + m
        Next
    End If
End If

 回到顶部