|
-
Aug 11th, 2010, 01:03 PM
#1
Thread Starter
PowerPoster
error 381 Subscript out of range
I have a form with 6 edible mshflexgrids that stays loaded throughout the life of my app. It can only be unloaded when the main form unloads. The main form holds a public module level variable that is set to true when the main form is unloading. Then the main form unloads all forms in the app:
Code:
Dim frm As Form
For Each frm In Forms
Unload frm
Set frm = Nothing
Next
The problem i am having is somehow the grids loose the amount of rows they are supposed to contain and i get the error 381 subscript out of range. Is their any way the mshflexgrids can loose the number of rows without unloading the form ?
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
-
Aug 11th, 2010, 01:11 PM
#2
Re: error 381 Subscript out of range
When do you get the error? Which lines of code and where?
-
Aug 11th, 2010, 01:42 PM
#3
Thread Starter
PowerPoster
Re: error 381 Subscript out of range
 Originally Posted by Merri
When do you get the error? Which lines of code and where?
thanks for the reply. this has been an ongoing problem and only happens guessing about 1 in 75 installs. my app sends me thru an online jmail the error# form name, sub name and line number, win ver, app version etc. the grids hold prices that are all tied together and loaded from a file. In other words the total price grid holds the totals of labor,materials, roof removal, etc. changing any values updates the total price grid. I do not know at what point the error occurs or why. in my error reporting routine I added this to tell me how many rows each grid contained:
the only grid with the correct number of rows is the GridFelts,
GridLabor rows 1
GridRoofRemoval rows 1
GridMaterial rows 1
gridProfit rows 1
GridTotalPrice rows 1
GridFelts rows 10
the only grid with the correct number of rows is the GridFelts, the rest should at least be 8 rows. i just do not understand how the grids loose their rows. Unfortunately when i make corrections, changes i have to wait for many users to install my app and that could be a month.
what i am thinking of adding is a routine to send me the number of rows on the form load right after the grids row,cols are set are filled with data, Hopefully before the error occures
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
-
Aug 11th, 2010, 01:50 PM
#4
Thread Starter
PowerPoster
Re: error 381 Subscript out of range
Btw, the error is not OS specific, had it happen on xp,vista and win 7
The error report i receive by email:
==Software Details==
Program Name : RoofCalcWriter (10.8.288)
App ExeName : RoofCalcWriter
App Path : C:\Program Files\RoofCalcWriter
==Computer Details==
OS Name : Windows XP - Service Pack 3
Processor Info: x86 Family 6 Model 8 Stepping 1, AuthenticAMD - Cores : 1
Computer Date : 8/11/2010 10:23:56 AM
Server Date : 8/11/2010 10:23:52 AM
==Error Details==
Module Name : frmNewPricePerSq
Function Name : Sub AddUpTotalPriceColumns
Line Number : 50
Error Number : 381
Error Desc : Subscript out of range.
Custom Message: Basic OS: Windows XP
Edition : Service Pack 3
Version Number: 5.1
Build Number : 2600
Product Name: Microsoft Windows XP
gMyPath: C:\Documents and Settings\All Users\Documents\RoofCalcWriter\AppFolder
Path To Program Files: C:\Program Files
Is 64 Bit: False
IsAdministrator: True
GridLabor rows 1
GridRoofRemoval rows 1
GridMaterial rows 1
gridProfit rows 1
GridTotalPrice rows 1
GridFelts rows 10
The user is behind a router/firewall.
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
-
Aug 11th, 2010, 02:01 PM
#5
Re: error 381 Subscript out of range
 Originally Posted by isnoend07
...The problem i am having is somehow the grids loose the amount of rows they are supposed to contain and i get the error 381 subscript out of range....
Are you making an assumption? How do you know how many rows were initially loaded? Maybe that is the problem, flexgrid failed to load the rows because file failed to load properly, corrupted, or something else. Maybe track the number of rows loaded from your file and include that in any error report for now? Just an idea.
-
Aug 11th, 2010, 02:20 PM
#6
Thread Starter
PowerPoster
Re: error 381 Subscript out of range
 Originally Posted by LaVolpe
Are you making an assumption? How do you know how many rows were initially loaded? Maybe that is the problem, flexgrid failed to load the rows because file failed to load properly, corrupted, or something else. Maybe track the number of rows loaded from your file and include that in any error report for now? Just an idea.
Thanks
The rows,cols are a fixed number, but you are correct in me assuming the data was loaded correctly. Good idea the file is created from a resource file if it does not exist and contains example data. Once saved it is no longer example data. I could also check the file size after the extraction and also get that info.
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
-
Aug 11th, 2010, 02:26 PM
#7
Thread Starter
PowerPoster
Re: error 381 Subscript out of range
this error may be computer-system specific, because i also got an error that has never occured before in an unrelated form file process:
Module Name : ROOFBIDDER
Function Name : Function Countit
Line Number : 100
Error Number : 62
Error Desc : Input past end of file
this is from the same PC as the 381 error
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|