Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting the focus to a specific cell in a datagrid

Status
Not open for further replies.

bigmelon

MIS
Sep 25, 2003
114
US
I have the following code for the current cell changed event of my datagrid:

If grdGases.CurrentCell.ColumnNumber = 10 Then
If ((Val(grdGases.Item(grdGases.CurrentRowIndex, 9)) < 6 Or Val(grdGases.Item(grdGases.CurrentRowIndex, 9)) > 8)) Then
MsgBox("Value Must Be Between 6 And 8")

End If
End If

This displays the message box if the user enters an inappropriate value in column 9, but I need to set the focus back there as well. Does anyone have any ideas on how to do this?

Thanks in advance,
Jeremy

 
How do I make that event fire while moving through the datagrid? Right now I can't get the event to fire.

Thanks,
Jeremy
 
I'm not so experienced with MS data grid, but I think that if you cahnge a cell value and move to another cell, the event should be fired. If you won't succeed, I'll try it myself.
 
I'm not so experienced with MS data grid, but I think that if you cahnge a cell value and move to another cell, the event should be fired. If you won't succeed, I'll try it myself.
 
No I put in breakpoints and in didn't do anything. The event never fired.

Jeremy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top