Solved

Subscript out of range Error Message

Posted on 2011-03-18
1
328 Views
Last Modified: 2012-05-11
Hi,

I have a function that which used to include this line:

varParts_GBL_identifier = Split(Forms!fdlgMain.tvw1.SelectedItem, " | ")

To enable the function to execute its code on more than one control I changed it so that it would accept a parameter.

The function is now called like this:

Call PopulateGlobal("Forms!fdlgMain.tvw1.SelectedItem")

and the previous line has been replaced with this:

varParts_GBL_identifier = Split(strControl, " | ")

(strControl is the string parameter)

Unfortunately this now produces this error message:

Error 9: Subscript Out Of Range

Any suggestions as to why its giving this error message?
0
Comment
Question by:andyw27
1 Comment
 
LVL 17

Accepted Solution

by:
JezWalters earned 500 total points
ID: 35164333
It looks like you're passing the string "Forms!fdlgMain.tvw1.SelectedItem" to your procedure, not the value of the control.  Try changing the Call to:

    Call PopulateGlobal(Forms!fdlgMain.tvw1.SelectedItem)
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

706 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now