Solved

Subscript out of range Error Message

Posted on 2011-03-18
1
329 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of utilizing SQL Server views 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 Access…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

920 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

15 Experts available now in Live!

Get 1:1 Help Now