aa=DataTables("订单").Select("[数量] = a")
应该改为:
aa=DataTables("订单").Select("[数量] = " & a)
建议看看:
http://www.foxtable.com/help/topics/1284.htm