Hi monarch_dodra and OReubens,

You are both right! I just implemented it the way you said and now it works perfectly.
Many thanks for your help!