Wrox Programmer Forums
|
VB Components Issues specific to components in VB.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Components section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 19th, 2006, 10:18 AM
Registered User
 
Join Date: Jun 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default runtime error 6148

I hope someone can help me with this problem. I have tried many ways and read extensively to overcome this problem.

The error appears when I try to write data to the grid that has a number of rows greater than what is physically in view. I will need to write approx. 100 rows. The following is some test code that demonstrates the
problem.


A Sub......
        For I = 1 To 61


        grdDataGrid.Row = I
        grdDataGrid.Col = 1
        grdDataGrid.Text = "Row" & I


        Next I


End Sub


It is a Bound Grid, and I am using VB6.


Any help would be greatly appreciated...


Alonsher




 
Old June 19th, 2006, 02:48 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Listen: No one memorizes error numbers... (I mean, you don't do you? Why would others?)
What is the err.description?
Which statement raises the error?
 
Old June 19th, 2006, 10:57 PM
Registered User
 
Join Date: Jun 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default



Sorry,


I use VB6 in windowsXP. I have a dbase table in a DBGRID control (data base is bound to DBgrid control). I want to obtain certain values from the grid. I use the following code

for rowNum=1 to NumberOfRows
grid.row= rowNum
grid.col= ColNum
x=grid.text ' the value I need is in x
next rowNum

This works fine for the first 4 rows (4 rows are visible on my grid) but when rowNum is 5, I get run time error 6148 - invalid row number. What can I do to get the values that I need?



Any help would be greatly appreciated...


By Alonsher




 
Old June 20th, 2006, 01:38 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

I'm not sure where you got NumberOfRows, but looking at what you posted this looks like a "zero-based" problem.
Items that are numbers are most often numbered as follows:

   0
   1
   2
   3
   4

That would be 5 rows. If you obtained the rowcount, you would need to use the following to access all rows:
Code:
    for rowNum = 0 to NumberOfRows -1





Similar Threads
Thread Thread Starter Forum Replies Last Post
hi i got runtime error 13 Type Mismatch error sriharsha345 Access VBA 2 February 21st, 2008 09:30 AM
runtime error dhoward VB.NET 2002/2003 Basics 2 November 1st, 2007 03:30 PM
runtime error??? jeffreyJS ASP.NET 2.0 Basics 4 September 14th, 2006 04:07 AM
mysterious error runtime error '451' coyotworks Excel VBA 1 May 12th, 2006 03:57 PM
Runtime Error rwiethorn ASP.NET 1.0 and 1.1 Basics 1 January 27th, 2004 02:01 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.