Solved

Subscript out of range Error Message

Posted on 2011-03-18
1
333 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
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.

734 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