Try an article at
www.computer-consulting.com/GridDyna.htm which addresses this issue. Basically it shows how to do this by using a grid class. The same code will work in a form but the class is much faster.
A problem is a problem only as long as it has a possible solution. Lacking that, it becomes a FACT!