Solved

Why is this sub not working?

Posted on 2014-01-10
3
182 Views
Last Modified: 2014-01-10
Private Sub Command2_Click()
Dim i As Integer
For i = 0 To gridCurrent.Rows - 1
gridCurrent.TextMatrix(i, 1) = "row " & gridCurrent.Row & " Col " & 1
Next


The grid only has 8 rows, but they all say:
Row 0 , Col 1
why do the rows not increment ?
0
Comment
Question by:isnoend2001
3 Comments
 
LVL 25

Assisted Solution

by:Shaun Kline
Shaun Kline earned 200 total points
Comment Utility
Are you referring to the same value being placed in column 1 of each row?

Most likely has to due with the reference to gridCurrent.Row in the For loop. This is a pointer to the current row, but you never change the current row.
0
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 300 total points
Comment Utility
you put the wrong variable:
For i = 0 To gridCurrent.Rows - 1
gridCurrent.TextMatrix(i, 1) = "row " & i & " Col " & 1
Next 

Open in new window

0
 

Author Closing Comment

by:isnoend2001
Comment Utility
Thanks
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now