I think you would do better to store the date and the incrementing number
separately. Your code could then be:
Me.Medicatie_ID = Nz(DMax("Medicatie_ID","tblMedicatie_Transacties", _
"DateField = " & Date),0) + 1
You may need to delimit the date value:
Me.Medicatie_ID = Nz(DMax("Medicatie_ID","tblMedicatie_Transacties", _
"DateField = #" & Date & "#"),0) + 1
For displaying, set the Control Source of an unbound text box to:
= Format(Date(),"yymmdd") & Format(Medicatie_ID,"000")
To store the entire number as it seems you are doing now you would need to
do something like format the date yymmdd, concatenate it with "001", convert
the result to a number, add 1, then format it to include a leading zero if
necessary. I can provide some more information if you decide you must go
that route, but I don't have the time right now to describe it.
I recommend incrementing the ID number separately from the date. The only
potential issue is that if ID is the primary key you will either need to add
a primary key (autonumber, perhaps) or use a multi-field primary key.