无法在 MS Access 查询的 IsError 函数中显示 NA

Not able to show NA in IsError function in MS Access query

我试图在我的计算字段中显示 'NA' 当结果显示错误时 query.But 它显示结果但对于错误它仍然显示 #Div/0!或#Num!。我该如何解决这个问题。我的计算字段表达式构建器是:

costDiffPerc: IIf(IsError(FormatPercent([costDiff]/([tb_MasterData]![Inq Gross Price]))),'NA',FormatPercent([costDiff]/([tb_MasterData]![Inq Gross Price])))

请帮我解决这个问题..如果有错误我只想显示 NA

是的,这似乎行不通。

与其试图捕捉错误,不如预防错误:

costDiffPerc: IIf([tb_MasterData]![Inq Gross Price]=0, 'NA', FormatPercent([costDiff]/([tb_MasterData]![Inq Gross Price])))