If r("产品自动编号") IsNot Nothing Then
改为:
If r.IsNull("产品自动编号") = False Then
看看:
http://www.foxtable.com/help/topics/1470.htm