I'm Minty, Micron is a different forum member.
You appear to have removed the default value I put in.
As I explained previously, you don't need to use code to fill that out, just use the default value, it will always appear on a new record.
=Nz(DMax("empno","main_data"),0)+1
And remove the code in your before update event.