因本月发放工资与前期某月的发放数据差不多,所以我想设计一个窗体:输入本月发放日期,同时选择要提取的指定发放月份,点击“确定”后,上月工资就自动被复制到本月来,请问这个代码怎么写?请指教,谢谢!
Dim tx1 As WinForm.TextBox = e.Form.Controls("TextBox1") '输入要发放的日期
Dim cb1 As WinForm.ComboBox = e.Form.Controls("ComboBox1") '输入要提取的日期
Dim t1 As String = tx1.Value
Dim t2 As String = cb1.Value
For Each dr1 As DataRow In DataTables("月报酬明细").Select("[发放日期] = t2")
Dim dr2 As DataRow = DataTables("月报酬明细").AddNew()
For Each dc As DataCol In DataTables("月报酬明细").DataCols
dr2(dc.Name) = dr1(dc.name)
Next
Next
请问怎么把“发放日期”自动修改成“要发放的日期”? 请指教,谢谢!
我日期时间格式设置的是:date,怎么预览显示的格式是datetime ?
还有点“确定”后,提示:.NET Framework 版本:4.0.30319.42000Foxtable 版本:2022.8.18.1
错误所在事件:窗口,数据提取,Button1,Click
详细错误信息:
该字符串未被识别为有效的 DateTime。有一个未知单词(从索引 0 处开始)。
请问怎么修改?谢谢!
调试技巧:http://www.foxtable.com/webhelp/scr/1485.htm,看哪一句代码出错
能查到在哪里出问题,但不会修改,请帮指导一下,谢谢!Dim tx1 As WinForm.TextBox = e.Form.Controls("TextBox1") '输入要发放的日期Dim cb1 As WinForm.ComboBox = e.Form.Controls("ComboBox1") '输入要提取的日期
Dim t1 As String = tx1.Value
Dim t2 As String = cb1.Value
For Each dr1 As DataRow In DataTables("月报酬明细").Select("[发放日期] = #t2#")
Dim dr2 As DataRow = DataTables("月报酬明细").AddNew()
For Each dc As DataCol In DataTables("月报酬明细").DataCols
dr2(dc.Name) = dr1(dc.name)
dr2("发放日期") = " #t1#"
Next
Next
这个帮助建议每天看一遍:
http://www.foxtable.com/webhelp/topics/1284.htm,看懂了能够提高50%的编码效率
此主题相关图片如下:1.png
For Each dr1 As DataRow In DataTables("月报酬明细").Select("[发放日期] = #" & t2 & "#")
Dim dr2 As DataRow = DataTables("月报酬明细").AddNew()
For Each dc As DataCol In DataTables("月报酬明细").DataCols
dr2(dc.Name) = dr1(dc.name)
dr2("发放日期") = t1