Problem with automatic reference number

I suspect you would like this idea Option to Lock the Reference field