I assume that you don't actually have all of the lines in your function remarked out.
I'd suggest changing the code to something like this:
Private Sub Form_Current()
If Me.NewRecord = true then
me.NCNumber = DMax("[NCNumber]","[tblNonConformances]","[AuditReference]=2") + 1
End if
End Sub
If you create your query in the query builder, instead of putting the DMax expression in the query you should just return MaxValue by right clicking the sort column and selecting Totals which will make it a group by query. Instead of grouping by NCNumber (the only column you should return), select Max and you will get the highest value of NCNumber. You can include the criteria AuditReference = 2 by selecting Where in the GroupBy cell of the query builder grid (just like you selected Max instead of GroupBy for NCNumber), and uncheck the box so only NCNumber will be returned.
Bob