加个判断算了:
If MainTable IsNot Nothing Then Dim cl As String For Each c As col In MainTable.cols cl = cl & c.name & "|" Next e.Form.Controls("Label1").Text = clEnd If