Thankyou craigreilly, however, it does not work in VB Express. Some parts of the code are not declared.