Assuming you mean for the numbers to start over next year, you could put
something like this in the form's Current event:
Me.YourField.DefaultValue =
Nz(DMax("[YourField]","[YourTable]","Year([DateField]) = " & Year(Date)),0)
+ 1
This assumes there is a date field in the record. Substitute your table and
field names for YourField, YourTable, and DateField.
To display the number you could have this as the control source of an
unbound text box:
= "M" & Format(Date(),"yy") & "-" & Format([YourField],"0000")
You could use the same expression in a query, or in VBA with some minor
alteration. In any case you could test to see if YourField is null, and
leave the text box empty if it is. Details depend on how you approach this.
In a multi-user environment you could place the code in the form's Before
Update event to minimize the chance of a duplicate number if two users
generate a record at the same time.