Did you make your form with Designer? It makes a difference to the example to provide.