感谢专家指教,临时表字段内容能在Table1中正常显示了.
再请教:如何设置由临时表传入的字段内容的颜色变成红色?
----如何在下面代码中追加语句?-----
Tables(e.Form.Name & "_Table1").DataSource = dtb.buildDatasource()
Tables(e.Form.Name & "_Table1").AllowEdit = True
Tables(e.Form.Name & "_Table1").DefaultColWidth = 80
Tables(e.Form.Name & "_Table1").Cols(0).Width = 30
Tables(e.Form.Name & "_Table1").Cols(1).Width = 150
Tables(e.Form.Name & "_Table1").Cols(2).Width = 200
Tables(e.Form.Name & "_Table1").Cols.Frozen = 3
'----------字段名称加载完成
For Each v As String() In DataTables("Product_PartList").GetValues("itemID|part_name|Specification","use_ok='Y'","itemID")
Dim dr1 As Row = Tables(e.Form.Name & "_Table1").AddNew()
dr1("itemID") = v(0)
dr1("part_name") = v(1)
dr1("Specification") = v(2)
Next
For Each r1 As Row In Tables(e.Form.Name & "_Table1").Rows
DataTables("Plan_MatchingList").LoadFilter = "item_id=" & r1("itemID")
DataTables("Plan_MatchingList").Load
Tables("Plan_MatchingList").Sort = "plan_name_no"
For Each cl As Col In Tables(e.Form.Name & "_Table1").Cols
r2 = Tables("Plan_MatchingList").FindRow("[plan_name_spec] ='" & cl.name & "'")
If r2 > 0 Then
r1(cl.name) = True
Tables(e.Form.Name & "_Table1").SetHeaderCellForeColor(cl.name, Color.Red)'能把有内容的字段标题变更红色
End If
Next
Next
再请教:如何设置由临时表传入的字段内容的文字颜色变成红色?
感谢感谢!
[此贴子已经被作者于2023/2/10 13:07:16编辑过]