Dim t As Table = Tables("表B") For Each a As OBJECT In t.grid.Parent.controls For Each b As OBJECT In a.controls If t.cols.Contains(b.text) Then For Each c As object In b.tabpages If t.cols.Contains(c.text) Then If t.Current.IsNull(c.text) Then c.image = Nothing Else c.image = getimage("d:\test.ico") End If End If Next End If Next Next