All that error means is that you have one too many END IF's for the number of IF's you have.
And, indeed, when I scanned for "if", that is true.
And, yes, the code seems to be trying to use comrs even though it never declares or initializes that recordset, so I agree that it seems to be missing code. But I don't know if that code in your second post is correct for the page in the first post. It seems to be for another purpose, for saving edits from a prior page instead of just pulliing up the data for one record.
I hate to say it, but it looks like your friend totally screwed up the page.
You don't have a backup copy of the code before he mucked with it?
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.