Thanks NJDude,
I spend better.
I created a library with B4A where I put the common classes that I then use within the main project for example (strings control, date control, etc ...)
In the Date Control function I should also point out that the date is wrong with a msgbox.
I compiled this library and loaded it into the main project through the Library Manager.
Now in the main project i have entered a edittext where the user inserts a date and in the FocusChanged and EnterPressed event of that check I called up the function to check the date.
The function is ok, but should display the msgbox when the date is wrong, but this does not appear to me.
I hope I've been clearer.
Thank you