Hi Techies

I recently added code to a form event called Shown to make certain cells of each row of my datagridview read-only. Then I set the focus of the datagridview to the last entry of the dgv with the following code.

dgvCashJournal.Focus()
dgvCashJournal.CurrentCell = dgvCashJournal(0,
dgvCashJournal.RowCount - 1)

The problem I am having is I get an index out of range exception when I attempt to do anything after the dgv is displayed. I cannot exit the routine or refresh the data. The person who gave me the original code is no longer available. I know I need to put some code in place to handle this exception but don't know where or how. Can anyone help?

Papiens