Even that elegant solution did not work. It still gives same error.
I really think that the issue has to do with the fact that no value (Electric or Recoil) exists on the database for the horsepType field.
It is not just that the value is null. It does not exist at all.
As I tried to explain to the other guy, when a user enters an account number, that account number is from a lookup table.
So, when the account number is entered, the main table is queried to see if any records associated with that account number already exists.
If yes, then the form is populated with the records for the user to either modify or leave as is.
If no record exists, then the user must enter records associated with account.
So, the issue is not the value for horsepType is null, no record of it exists.
I wonder if doing a LEFT JOIN could fix the problem.