Click here to Skip to main content
15,905,071 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have attached a code in VB 6.0 below :
If iFrameIndex = 29 Then
            With structAccountDetails.seqTaxLicType (iIndex).seqVehicleDetails(0)
                mskBondCompany.Text = EMPTYBONDCOMPANY
                mskBondAmountMFT.Text = "";
                mskBondCompany.SelText = .strVehicleNo
                mskBondAmountMFT.SelText = .mnyStateTax
               
                If .mnyCityTax = "0" Then
                                    txtBondNumber(1).Text = "";
                Else
                    txtBondNumber(1).Text = .mnyCityTax
                End If
                txtPermitNumber(1).Text = .dtEnteredDate
            End With
    End If

While debug , the error "Subscript Out Of Range.Please Contact System Administrator" comes in the line :

With structAccountDetails.seqTaxLicType(iIndex).seqVehicleDetails(0)

and then it moves over to the ErrorHandler function stating it as a fatal error.

Here and in other parts of this module, i have changed the mnyCityTax variable to String from Integer. I have changed everything in the Middleware C++ code as well as made changes in the database such that the corresponding entry for mnyCityTax goes into the relevant table as a string and not as an Integer.

But , i recieve a "Subscript Out Of Range.Please Contact System Administrator" Error while i click on the button that calls the mnyCity Tax variable in VB.

Other parts of the module concerning
1)ReDim structAccountDetails.seqTaxLicType(-1 To -1)

2)structAccountDetails.seqTaxLicType = structAccountDetailsUpdT.seqTaxLicType
                    ReDim Preserve structAccountDetails.seqTaxLicType(UBound(structAccountDetails.seqTaxLicType) + 1)


The declaration stands as :
Dim structAccountDetails    As TAXMANTRABROKERLib.iAccountDetailsRow


Is there something to do with the declaration? Previously, it was working fine with the table having the column as Integer. I have just changed the column type in the table as varchar. But it shows error.

Can somebody help me?
I am in the middle of a project.

Thanks in advance
Posted
Updated 14-Dec-10 22:56pm
v3
Comments
Abhinav S 15-Dec-10 1:15am    
Code blocks added.
Venkatesh Mookkan 15-Dec-10 21:31pm    
You are supposed to mark the Answer if it helps you

Please check
structAccountDetails.seqTaxLicType(iIndex) 

or
structAccountDetails.seqTaxLicType (iIndex).seqVehicleDetails(0)

has values. It seems like either one does not have any item.
(i.e) Length = 0
 
Share this answer
 
v2
Comments
Toniyo Jackson 15-Dec-10 4:23am    
Always write your code inside code block
Does it have something to do with iFrameIndex and iIndex?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900