用静态变量:
Static b As Boolean
If b = False Then
Dim dt As Boolean = False
Dim dr As DataRow = DataTables("订单明细").Find("进度 = " & dt & "")
If dr IsNot Nothing Then
b = True
MessageBox.Show("有产品即将到期!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
b = False
Tables("订单明细").Filter = "进度 = " & dt & ""
MainTable = Tables("订单明细")
End If
End If
参考:
http://www.foxtable.com/help/topics/1061.htm