Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA 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 April 23rd, 2008, 08:52 PM
Authorized User
 
Join Date: Apr 2005
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Default "Subscript out of range" in acFormPivotChart

I have this Sub:

Code:
Public Sub MakeForm()
vSQLDatos = "select * from [ttemp];"
Dim rsSQLDatos As Recordset
Set rsSQLDatos = CurrentDb.OpenRecordset(vSQLDatos)

Set frm = CreateForm
frm.RecordSource = vSQLDatos

vLeft = 1000
For i = 0 To rsSQLDatos.Fields.Count - 1

    Set ctlText = CreateControl(frm.Name, acTextBox, acDetail, "", rsSQLDatos(i).Name, vLeft * i, 8, vLeft * 0.91, 250)
    ctlText.Name = rsSQLDatos(i).Name

Next i

Dim vArrayDatos(50) As Variant
Dim vArrayOtros(50) As Variant

    DoCmd.OpenForm frm.Name, acFormPivotChart

    vArrayDatosi = 0
    vArrayOtrosi = 0
    For i = 0 To rsSQLDatos.Fields.Count - 1
        If Right(rsSQLDatos(i).Name, 1) = "z" Then 'los datos, con los datos... y los números con los números
        vArrayDatos(vArrayDatosi) = rsSQLDatos(i).Name 'Para el array de los campos a incluir
        vArrayDatosi = vArrayDatosi + 1
        Else
        vArrayOtros(vArrayOtrosi) = rsSQLDatos(i).Name 'Para el array de los campos a incluir
        vArrayOtrosi = vArrayOtrosi + 1
       End If
    Next i

Set chConstants = Forms(Forms.Count - 1).ChartSpace.Constants
Set chartss = Forms(Forms.Count - 1).ChartSpace
    chartss.SetData chConstants.chDimValues, chConstants.chDataBound, "Agua Inyectada a piscinas Km3z" 
    chartss.SetData chConstants.chDimCategories, chConstants.chDataBound, vArrayOtros

End Sub
My problem is here:
chartss.SetData chConstants.chDimValues, chConstants.chDataBound, "Agua Inyectada a piscinas Km3z"
I get "Subscript out of range".

I'm sure is because "Agua Inyectada a piscinas Km3z" plus "Suma de " has more than 24 characters long.

Any ideas how to solve it?

Thank you in advance!
Saludos.

Oh, I'm using "owc11.dll".






Similar Threads
Thread Thread Starter Forum Replies Last Post
Array, Subscript out of range. koss77 VB How-To 4 August 21st, 2006 09:35 AM
Subscript out of range: '[number: 0]' jim_h Classic ASP Professional 0 February 24th, 2006 07:24 PM
Subscript out of range rfrancisco Classic ASP Components 1 February 13th, 2006 08:25 PM
Subscript out of range crmpicco Classic ASP Basics 4 March 22nd, 2005 06:55 PM
Problem of "Subscript out of range " liorlank Classic ASP Components 2 November 26th, 2003 10:45 AM





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