Skip to content

Replies

0
april
april answered on Sep 22, 2009 7:10 AM

Have you tried the code given by me ? after the message box try setting the active row and active cell and then write exit for ? let me know how it goes.

0
april
april answered on Sep 18, 2009 7:03 AM

Please see the lines in 'Bold, Underline and Italic'

Dim CheckValue As String
For i As Integer = 0
To
(grdInvoice.Rows.Count) – 2
CheckValue = grdInvoice.Rows(i).Cells(0).Value.ToString

If CheckValue = Item Then
grdInvoice.Rows(i).Cells(0).Selected =
True
MsgBox("Item Already Exists"
) 

grdInvoice.ActiveRow = grdInvoice.Rows(j)

 

grdInvoice.ActiveCell = grdInvoice.Rows(i).Cells(0)

 

Exit For
End If
Next