Solved

Why is this sub not working?

Posted on 2014-01-10
3
189 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 26

Assisted Solution

by:Shaun Kline
Shaun Kline earned 200 total points
ID: 39771099
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 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 300 total points
ID: 39771124
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
ID: 39771138
Thanks
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses
Course of the Month6 days, 1 hour left to enroll

627 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