If DataTables("订单管理").DataRows.Count = 0 Then '如果订单表没有数据 DataTables("订单色组").LoadFilter = "订单条码 Is Null" '不加载订单明细 Else Dim ids As String For Each dr As DataRow In DataTables("订单管理").DataRows ids = ids & ",'" & dr("订单条码") & "'" Next ids= ids.Trim(",") DataTables("订单色组").LoadFilter = "订单条码 In (" & ids & ")" End If DataTables("订单色组").Load()