以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=61990)

--  作者:tungwun
--  发布时间:2014/12/23 18:04:00
--  [求助]
请问如何用月份天数新增行,如2014年12月有31天,用按钮新增31行,月份30天就新增30行,自动复制上一行指定资料?
--  作者:有点甜
--  发布时间:2014/12/23 18:07:00
--  
 Dim n As Integer = Date.DaysInMonth(Date.Today.Year, Date.Today.Month)
Dim dr As Row = Tables("表a").Current
For i As Integer = 1 To n
    Dim ndr As DataRow = DataTables("表A").AddNew
    ndr("第一列") = dr("第一列")
    ndr("第二列") = dr("第二列")
Next

--  作者:tungwun
--  发布时间:2014/12/23 18:26:00
--  [求助]
请问如何指定年份月份做新增行?
--  作者:有点甜
--  发布时间:2014/12/23 19:07:00
--  
Dim n As Integer = Date.DaysInMonth(2014, 12)
Dim dr As Row = Tables("表a").Current
For i As Integer = 1 To n
    Dim ndr As DataRow = DataTables("表A").AddNew
    ndr("第一列") = dr("第一列")
    ndr("第二列") = dr("第二列")
Next

--  作者:tungwun
--  发布时间:2014/12/23 20:50:00
--  [求助]
请问如何做这个代码,新增行加入年份\'月份及日
图片点击可在新窗口打开查看此主题相关图片如下:image 2.png
图片点击可在新窗口打开查看
[此贴子已经被作者于2014-12-23 20:52:41编辑过]

--  作者:有点甜
--  发布时间:2014/12/23 20:57:00
--  

Dim y As Integer = e.Form.Controls("ComboBox1").Text

Dim m As Integer = e.Form.Controls("ComboBox2").Text

 

Dim n As Integer = Date.DaysInMonth(y, m)
Dim dr As Row = Tables("表a").Current
For i As Integer = 1 To n
    Dim ndr As DataRow = DataTables("表A").AddNew
    ndr("第一列") = dr("第一列")
    ndr("第二列") = dr("第二列")
Next


--  作者:tungwun
--  发布时间:2014/12/23 22:00:00
--  [求助]
请问可否在第一列加入comboBox1的年份 第二列comboBox2加入月份 第三列自动加入日期如 1号,2号,3号......
--  作者:有点甜
--  发布时间:2014/12/23 22:03:00
--  

Dim y As Integer = 2014
Dim m As Integer = 12

Dim n As Integer = Date.DaysInMonth(y, m)
Dim dr As Row = Tables("表a").Current
For i As Integer = 1 To n
    Dim ndr As DataRow = DataTables("表A").AddNew
    ndr("第一列") = y
    ndr("第二列") = m
    ndr("第三列") = i & "号"
Next
 


--  作者:tungwun
--  发布时间:2014/12/23 23:02:00
--  谢谢
谢谢工作快了很多,
有个问题,按下按钮新增正常新增行,但多按一次就新增多了,可否加一个按钮删除多新增的行?


--  作者:有点甜
--  发布时间:2014/12/23 23:06:00
--  

 不能确定哪些才算是多新增的行,简单一点的方法

 

DataTables("表A").RejectChanges