hi @Mehta_Tech
A slight change is to breakdown the code (same thing you doing just differently):
//Get the last entry for month from the title
Set(_MonthLastEntry,Mid(Last(_InvoiceIndex).Invoice,5,2));
//increase the invoice count if the current month number = that value. im using a txtbox to illustrate
Set(_InvNumber,If(txtMonth.Text = _MonthLastEntry, _InvNumber+1,1));
the collection shows the result
Without the if statement in increasing the invoice count

With the if statement

I hope this can help