Please have a look to the project attached. Running and stopping the project 5 to 10 times, I found it to behave differently. I can not change the date after the future data has been selected.
Your logic is a bit messy! That second If is redundant
B4X:
If dtp.Value > Now Then
rr=1
If rr = 1 Then
Try resetting any future date to the present
B4X:
If dtp.Value > Now Then
dtp.Value = now
Sorry but the BackColor property, despite being present, has no effect on a DateTimePicker as I found out when I read the entire documentation about it on MSDN. A Microsoft quirk I assume.