The Msgbox was just to show you what value "z" held, a troubleshooting method I often use. It doesn't really need to be there for your code.
I haven't worked with DataGridView but if it's anything like ListView, ComboBox, etc... then you have a specific Index you need to be aware of. It'll start with either 0 or 1.
If it starts at 0 and you're getting that error right at the start then "z" at that point...
User Profile
Collapse
-
Looks to me like "z-1" is lower than your DataGrid index. You could put a message box just before that line to see what "z" is at that point.
I always use the MsgBox to find out what a variable is showing. You may...Code:... i = i + 1 Next [B]MsgBox(z)[/B] DataGridView1.Rows(z - 1).Cells("DETAILS").Value = logs & " [" & CInt(HOURSWORKED / 60) & "]" ...Leave a comment:
-
Replacing Text Automatically - VB8
This was asked on CodeProject also but I haven't received a working reply so am posting here. The only reply I did get there suggested using "e.Handled = true" but that didn't work no matter where I put it.
Below is the section I'm having trouble with at the moment:
...Code:Friend Sub glbHooks_KeyPress(ByVal sender As Object, ByVal e As KeyPressEventArgs) Handles glbHooks.KeyPress newStr
No activity results to display
Show More
Leave a comment: