I only posted your code with indents and code tags so its readable.
My point was you need to set cancel = true.
Your cancel argument could be as simple as
But we dont know enough about your data to be precise.Code:cancel = DCount("nummer", "bonnen_status", "nummer=" & Me.Nummer & " and soort=" & Me.Soort)