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
Solved

Why is this sub not working?

Posted on 2014-01-10
3
186 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 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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

792 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