'意和打印选择表_出库明细表模拟关联表:
Dim t1 As Table = Tables("意和打印窗口_出库明细表")
With Tables("意和打印选择表")
If .Current Is Nothing Then
t1.Filter = "False"
Else
t1.Filter = "打印_意和 = '" & .Current("打印_意和") & "'" '整数列与单精列的区别
End If
End With
t1.OpenView("default")
'打开窗口后,Tables("意和打印窗口_出库明细表")只显示当前选定行.
Dim d As Date
If Tables("意和打印窗口_出库明细表").Rows.Count <> 0 AndAlso Date.TryParse(Tables("意和打印窗口_出库明细表").Current("出库日期"), d) Then
d = d.Date
Dim bh As String = "YH" & Format(d, "yyMMdd")
Dim max As String
Dim idx As Integer
Dim fdr As DataRow = DataTables("意和打印记录表").Find("日期 = #" & d & "#")
If fdr Is Nothing Then
fdr = DataTables("意和打印记录表").AddNew
fdr("日期") = d
fdr("次数") = 0
End If
e.Form.Controls("出库编号").Text = bh & Format(fdr("次数") + 1, "000")
End If
'Tables("意和打印选择表.入库明细表").SetHeaderRowHeight(12)
Tables("意和打印窗口_出库明细表").SetHeaderRowHeight(22,22)
'Tables("意和打印选择表.入库明细表").Sort = "出库日期"
'自动调整行高
Dim t As Table = Tables("意和打印窗口_出库明细表")
t.AutoSizeRows
t.AllowResizeSingleRow = True
'With Tables("意和打印窗口_出库明细表")
' .Cols("出库数量_过磅").GrandTotal = True
' .Cols("出库金额_应收").GrandTotal = True
' .GrandTotal = True
'End With
e.Form.controls("出库日期").text = Date.Now
e.Form.controls("开piao人").text = user.name