update datagrid

i have the edit and cancel buttons working fine but im workin through the updat now,
i have come across the problem,
type textbox not declared, any one know a resolution,
any ideas at all would be most helpful
VB Code:
  1. Private Sub CustomMsgDA1_UpdateCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles CustomMsgDA1.UpdateCommand
  2.         Dim key As String = CustomMsgDA1.DataKeys(e.Item.ItemIndex).ToString()
  3.  
  4.         Dim msg1, msg2 As String
  5.         Dim tb As TextBox
  6.         tb = CType(e.Item.Cells(2).Controls(0), TextBox)
  7.         msg1 = tb.Text
  8.         tb = CType(e.Item.Cells(3).Controls(0), TextBox)
  9.         msg2 = tb.Text
  10.  
  11.     End Sub