Top tip spikepl!! Not only did your suggestion work but the code is so much more simple! This is what I ended up with:
Dim a1 As Integer
Dim intanswer As Integer
Dim sql As String
Dim db As DAO.Database
Set db = CurrentDb
a1 = DCount("UnitPriceNew", "tblparts", "UnitPriceNew = 0")
If a1 > 0...