Do you happen to use Withholding Taxes? When withholding taxes are applied it creates a separate line(which may have a blank value for the column you're checking) when the record is saved even though the tax code is entered at the same line as the items. Just an idea.