Foxtable(狐表)用户栏目专家坐堂 → 帮我看看这个代码错在哪里,谢谢


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

主题:帮我看看这个代码错在哪里,谢谢

帅哥哟,离线,有人找我吗?
大红袍
  11楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/7/20 17:12:00 [只看该作者]

没收到,你自己就调试一下 http://www.foxtable.com/webhelp/scr/1485.htm

 

 

 


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


加好友 发短信
等级:二尾狐 帖子:524 积分:3676 威望:0 精华:0 注册:2012/7/27 10:28:00
  发帖心情 Post By:2016/7/20 17:35:00 [只看该作者]

Dim chk As WinForm.CheckBox
chk = Forms("员工工资系统").Controls("是否满勤")
Dim jkje As WinForm.TextBox = e.Form.Controls("TB借款金额")
Dim kcfk As WinForm.TextBox = e.Form.Controls("TB扣除罚款")
Dim shbx As WinForm.TextBox = e.Form.Controls("TB社会保险")
Dim hjkc As WinForm.Label = e.Form.Controls("扣除金额")
Dim v1 As Double = Val(jkje.Text)
Dim v2 As Double = Val(kcfk.Text)
Dim v3 As Double = Val(shbx.Text)
MessageBox.Show(30)
Dim scbt As WinForm.TextBox = e.Form.Controls("TB生产补贴")
Dim clbt As WinForm.TextBox = e.Form.Controls("TB差旅补贴")
Dim fybx As WinForm.TextBox = e.Form.Controls("TB费用报销")
Dim btje As WinForm.Label = e.Form.Controls("补贴金额")
Dim v4 As Double = Val(scbt.Text)
Dim v5 As Double = Val(clbt.Text)
Dim v6 As Double = Val(fybx.Text)
MessageBox.Show(31)
Dim gzlb As WinForm.Label = e.Form.Controls("工资类别")
Dim tbgz As WinForm.TextBox = e.Form.Controls("TB工资数据")
Dim gzss As WinForm.TextBox = e.Form.Controls("TB工作时间")
Dim gzts As WinForm.TextBox = e.Form.Controls("TB工作天数")
Dim yfgz As WinForm.Label = e.Form.Controls("应发工资")
Dim mqts As WinForm.TextBox = e.Form.Controls("TB天数")
Dim sfgz As WinForm.Label = e.Form.Controls("实发工资")
Dim xg As WinForm.TextBox = e.Form.Controls("TB工资修改")
MessageBox.Show(32)
Dim g1 As Double = Val(tbgz.Text)
Dim g2 As Double = Val(gzss.Text)
Dim g3 As Double = Val(gzts.Text)
Dim g4 As Double = Val(mqts.Text)
Dim j1 As Double = Val(xg.Text)

Dim k As Double
Dim d As Double
Dim d2 As Double
Dim d3 As Double
Dim d4 As Double
Dim d5 As Double
Dim d6 As Double
Dim d7 As Double
Dim d8 As Double

If chk.Checked = True Then
    k = v2
MessageBox.Show(1)
Else
    k = v2 + 100
MessageBox.Show(2)
End If

d = v1 + k + v3
MessageBox.Show(3)
d2 = v4 + v5 + v6
MessageBox.Show(4)
d3 = g1 * g2
MessageBox.Show(5)
d4 = g1 * g2 - d + d2
MessageBox.Show(6)
d5 = g1 / g4 * g3
MessageBox.Show(7)
d6 = g1 / g4 * g3 - d + d2
MessageBox.Show(8)
d7 = g1
MessageBox.Show(9)
d8 = g1 - d + d2
MessageBox.Show(10)

If d > 0 Then
    e.Form.Controls("扣除金额").Visible=True
    e.Form.Controls("L扣元").Visible=True
    hjkc.text =format(d,"n")
Else
    e.Form.Controls("扣除金额").Visible=False
    e.Form.Controls("L扣元").Visible=False
End If
If d2 > 0 Then
    e.Form.Controls("补贴金额").Visible=True
    e.Form.Controls("L补元").Visible=True
    btje.text =format(d2,"n")
Else
    e.Form.Controls("补贴金额").Visible=False
    e.Form.Controls("L补元").Visible=False
End If


If  gzlb.text= "计时工资" Then
    If xg.text ="" Then
        If d3 > 0  Or d4 > 0 Then
            e.Form.Controls("应发工资").Visible=True
            e.Form.Controls("实发工资").Visible=True
            e.Form.Controls("L1元").Visible=True
            e.Form.Controls("L实元").Visible=True
            Tables("工资报表").Current("正常工资") = format(d3,"n")
MessageBox.Show(11)
            Tables("工资报表").Current("实发工资") =format(d4,"n")
MessageBox.Show(12)
        Else
            e.Form.Controls("应发工资").Visible=False
            e.Form.Controls("L1元").Visible=False
            e.Form.Controls("实发工资").Visible=False
            e.Form.Controls("L1元").Visible=False
        End If
    Else
        e.Form.Controls("应发工资").Visible=True
        e.Form.Controls("实发工资").Visible=True
        e.Form.Controls("L1元").Visible=True
        e.Form.Controls("L实元").Visible=True
        Tables("工资报表").Current("正常工资") = format(d3,"n")
MessageBox.Show(13)
        Tables("工资报表").Current("实发工资") =format(j1,"n")
MessageBox.Show(14)
    End If
Else
    If gzlb.text= "固定工资" Then
        If chk.Checked = True Then
            If xg.text ="" Then
                If d7 > 0  Or d8 > 0 Then
                    e.Form.Controls("应发工资").Visible=True
                    e.Form.Controls("实发工资").Visible=True
                    e.Form.Controls("L1元").Visible=True
                    e.Form.Controls("L实元").Visible=True
                    Tables("工资报表").Current("正常工资") = format(d7,"n")
MessageBox.Show(15)
                    Tables("工资报表").Current("实发工资") =format(d8,"n")
MessageBox.Show(16)
                Else
                    e.Form.Controls("应发工资").Visible=False
                    e.Form.Controls("L1元").Visible=False
                    e.Form.Controls("实发工资").Visible=False
                    e.Form.Controls("L1元").Visible=False
                End If
            Else
                e.Form.Controls("应发工资").Visible=True
                e.Form.Controls("实发工资").Visible=True
                e.Form.Controls("L1元").Visible=True
                e.Form.Controls("L实元").Visible=True
                Tables("工资报表").Current("正常工资") = format(d7,"n")
MessageBox.Show(17)
                Tables("工资报表").Current("实发工资") =format(j1,"n")
MessageBox.Show(18)
            End If
        Else
            If xg.text ="" Then
                If d5 > 0  Or d6 > 0 Then
                    e.Form.Controls("应发工资").Visible=True
                    e.Form.Controls("实发工资").Visible=True
                    e.Form.Controls("L1元").Visible=True
                    e.Form.Controls("L实元").Visible=True
                    Tables("工资报表").Current("正常工资") = format(d5,"n")
MessageBox.Show(19)
                    Tables("工资报表").Current("实发工资") =format(d6,"n")
MessageBox.Show(20)
                Else
                    e.Form.Controls("应发工资").Visible=False
                    e.Form.Controls("L1元").Visible=False
                    e.Form.Controls("实发工资").Visible=False
                    e.Form.Controls("L1元").Visible=False
                End If
            Else
                e.Form.Controls("应发工资").Visible=True
                e.Form.Controls("实发工资").Visible=True
                e.Form.Controls("L1元").Visible=True
                e.Form.Controls("L实元").Visible=True
                Tables("工资报表").Current("正常工资") = format(d5,"n")
MessageBox.Show(21)
                Tables("工资报表").Current("实发工资") =format(j1,"n")
MessageBox.Show(22)
            End If
        End If
    End If
End If

 

 

这样吗?怎么没有反映啊


 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  13楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/7/20 18:06:00 [只看该作者]

对的,加入msgbox,看弹出到哪个msgbox。

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


加好友 发短信
等级:二尾狐 帖子:524 积分:3676 威望:0 精华:0 注册:2012/7/27 10:28:00
  发帖心情 Post By:2016/7/20 18:12:00 [只看该作者]

 

你帮我看看,在员工工资系统,点工资报表会非法操作,并关闭,还有,工资修改窗口扣除罚款,输入后不能去掉

[此贴子已经被作者于2016/7/21 1:32:06编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  15楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/7/20 18:13:00 [只看该作者]

1、密码

 

2、数据库


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


加好友 发短信
等级:二尾狐 帖子:524 积分:3676 威望:0 精华:0 注册:2012/7/27 10:28:00
  发帖心情 Post By:2016/7/20 18:22:00 [只看该作者]

 

[此贴子已经被作者于2016/7/21 1:32:24编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  17楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/7/20 20:25:00 [只看该作者]

1、非法操作怎么出问题?我测试没问题

 

2、你textChanged事件的代码,写到valueChanged事件去即可。


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


加好友 发短信
等级:二尾狐 帖子:524 积分:3676 威望:0 精华:0 注册:2012/7/27 10:28:00
  发帖心情 Post By:2016/7/20 21:26:00 [只看该作者]


图片点击可在新窗口打开查看此主题相关图片如下:cw.jpg
图片点击可在新窗口打开查看

 


员工工资系统,点击报表,把滑块拉最下面,双击工资报表会非法操作,并关闭


 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  19楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/7/20 21:46:00 [只看该作者]

currentChanged事件,原本代码去掉,改成下面的

 

If e.Table.Current Is Nothing Then '如果Current为Nothing
    Return '则返回
End If
If Forms("工资修改").Opened Then
    Dim lbl2 As WinForm.Label
    lbl2 = e.Form.Controls("选中行")
    lbl2.Text = " 现在编辑的是员工"&   (Tables("工资报表").Current("所属年份"))   & "年 " &   (Tables("工资报表").Current("所属月份"))   &" 月,姓名为: " &   (Tables("工资报表").Current("员工姓名"))   &   " 的员工工资"
End If

Dim idx As Integer =  Tables("员工信息").FindRow("[_Identify] = " & e.Table.Current("序号"))
If idx > - 1 Then '如果找到符合条件的行
    Tables("员工信息").Position = idx '则选择该行
End If


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


加好友 发短信
等级:二尾狐 帖子:524 积分:3676 威望:0 精华:0 注册:2012/7/27 10:28:00
  发帖心情 Post By:2016/7/20 21:59:00 [只看该作者]


图片点击可在新窗口打开查看此主题相关图片如下:cw.jpg
图片点击可在新窗口打开查看

 

为什么在工资修改的窗口里,这几输入框不能就改已经输入的内容啊


 回到顶部
总数 34 上一页 1 2 3 4 下一页