以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]求[确定]按钮代码  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=183105)

--  作者:老鼠
--  发布时间:2022/10/24 16:07:00
--  [求助]求[确定]按钮代码
这是目前按钮代码:

Dim qsr As WinForm.DateTimePicker = e.Form.Controls("合同起始日")
Dim zzr As WinForm.DateTimePicker = e.Form.Controls("合同终止日")
Dim syq As WinForm.ComboBox = e.Form.Controls("试用期")
Dim qx As WinForm.ComboBox = e.Form.Controls("合同期限")
Dim bm As WinForm.ComboBox = e.Form.Controls("聘用部门")
Dim gw As WinForm.ComboBox = e.form.Controls("聘用岗位")
Dim fr As WinForm.TextBox = e.Form.Controls("法人")

If qsr.Value = zzr.Value Then \'若合同起始日与合同终止日的值均相同
    MessageBox.Show("合同起始日与合同终止日不能是同一天!")
ElseIf qsr.Value Is Nothing Then \'若合同起始日为空
    MessageBox.Show("合同起始日未录入日期!")
ElseIf zzr.Value Is Nothing Then \'若合同终止日为空
    MessageBox.Show("合同终止日未录入日期!")
ElseIf bm.Value = "" Then \'若聘用部门为空
    MessageBox.Show("未输入聘用部门!")
ElseIf gw.Value = "" Then \'若聘用岗位为空
    MessageBox.Show("未输入聘用岗位!")
ElseIf fr.Value = "" Then \'若法人为空
    MessageBox.Show("未输入法人!")
    
Else
    Dim r0 As Row = Tables("基础信息").Current 
    Dim r As Row = Tables("签订合同").AddNew
    r("姓名") = r0("姓名") 
    r("身份证号码") = r0("身份证号码")
    r("性别") = r0("性别")
    r("住址") = r0("住址")
    r("电话") = r0("联系电话")
    r("合同期限") = qx.Value
    r("合同起始日") = qsr.Value
    r("合同终止日") = zzr.Value
    r("试用期") = syq.Value
    r("聘用部门") = bm.Value
    r("聘用岗位") = gw.Value
    r("法人") = fr.Value
    
    r0("工作部门") = bm.Value
    r0("合同到期日") = zzr.Value
    e.Form.Close
    
End If

图片点击可在新窗口打开查看此主题相关图片如下:微信图片_20221024160925.png
图片点击可在新窗口打开查看
这是报错窗口

[此贴子已经被作者于2022/10/24 16:10:14编辑过]

--  作者:有点蓝
--  发布时间:2022/10/24 16:14:00
--  
组合框被定义成文本框了

Dim fr As WinForm.ComboBox = e.Form.Controls("法人")