Hi David!
Thank you so much for your interest and help! I checked the VBA code and it worked! This is the solution I found and used with succes this morning:
Me.treatmentnr = Nz(DMax("[treatmentnr]", "Tbl_treatment", "[ID]&[tumornr]= " & Me.IDr & Me.tumornr), 0) + 1
Judy