Dim gs As String = Forms("窗口").Controls("ComboBox1").Text '工时
If gs = "" Then
MessageBox.Show("请选择工时!","提示")
Return
End If
Dim sl As String = Forms("窗口").Controls("TextBox1").Text '数量
If sl = "" Then
MessageBox.Show("请填写数量!","提示")
Return
End If
Dim gs1 As Integer = CDbl(gs) * 1000
Dim sl1 As Integer = CDbl(sl) * 1000
Dim i As Integer = 0
For i = 1 To CDbl(sl)
Dim f As New Filler
f.SourceTable = DataTables("B") '指定数据来源
f.SourceCols = "组别,工位,员工,工piao,工时" '指定数据来源列
f.DataTable = DataTables("C") '指定数据接收表
f.DataCols = "组别,工位,员工,工piao,工时" '指定数据接收列
f.Fill() '填充数据
'填充数量
For Each dr As DataRow In DataTables("C").DataRows
If dr.IsNull("计数") Then
dr("计数") = i
End If
Next
DataTables("C").Save()
Dim lbl As WinForm.Label = e.Form.Controls("Label1")
lbl.Text = "第 "& i &" 次"
'延时
Application.DoEvents
Next
http://www.foxtable.com/help/topics/1476.htm