473,320 Members | 1,939 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Strange dim array problem...

I have this really weird problem. When I dim a dyamic array, it doesn't seem to be working... because when I access the array, I get this error:

Microsoft VBScript runtime error '800a0009'

Subscript out of range

Here's the code where I dim my array:

Expand|Select|Wrap|Line Numbers
  1. dim selectedresorg()
I then try to assign a value to the array like this:

Expand|Select|Wrap|Line Numbers
  1. selectedresorg(0) = (rsResources.Fields.Item("ORG_ID").Value)
This is where it breaks. The only way this assignment works is if I statically define the array like so:

Expand|Select|Wrap|Line Numbers
  1. dim selectedresorg(5)
Does anyone know why I'm having this issue? As far as I know, I'm defining the array correctly.

Thanks for any help.

Tom

tomgrow AT gmail
Aug 28 '08 #1
2 1205
Krandor
50
You have created an array with zero records. So you can't update a record (which is what you are trying to do) until you have at least 1 record.
Aug 28 '08 #2
jhardman
3,406 Expert 2GB
The best way I have found around this problem is to use the split() function:
Expand|Select|Wrap|Line Numbers
  1. dim longString, anArray
  2. longString = "Jim,Joe,Jerry,Jenny"
  3. longString = longString & ",Barnard"
  4. longString = longString & ",Betty"
  5.  
  6. anArray = split(longString, ",")
Let me know if this helps.

JAred
Aug 30 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Phil | last post by:
Hi, I don't understand this strange behaviour: I compile this code : #include <Python.h> #include"Numeric/arrayobject.h" static PyObject *
5
by: Rob Ristroph | last post by:
Hi, It's pretty unhelpful to post "I have a huge piece of code that crashes in strange places, what's the problem?" but that's basically my problem and I really am at my wit's end. The piece...
7
by: cppaddict | last post by:
Hi, I've been trying to debug a strange runtime error for the last 5 hours... I'm hoping someone might have an insight about it. I have an application that creates a vector of MyDisplay...
3
by: Bruno van Dooren | last post by:
Hi All, i have some (3) different weird pointer problems that have me stumped. i suspect that the compiler behavior is correct because gcc shows the same results. ...
3
by: Sameh Halabi | last post by:
Hi I have a strange problem in C , I hope someone may help with it . the problem is as follows : I have an existing big structure (that I can't change) which contains in it groups of...
6
by: Edd Dawson | last post by:
Hi. I have a strange problem involving the passing of command line arguments to a C program I'm writing. I tried posting this in comp.programming yesterday but someone kindly suggested that I'd...
2
by: Bruno van Dooren | last post by:
Hi All, i have some (3) different weird pointer problems that have me stumped. i suspect that the compiler behavior is correct because gcc shows the same results. ...
11
by: Martin Joergensen | last post by:
Hi, I've encountered a really, *really*, REALLY strange error :-) I have a for-loop and after 8 runs I get strange results...... I mean: A really strange result.... I'm calculating...
2
by: rkk | last post by:
Hi, My mergesort program is below. There is a small piece of logical error/bug in this code which I can't figure out, as a result the output array isn't completely sorted. Requesting your help...
5
by: MN | last post by:
Hi, I was writing a program that must dynamically allocate memory to a 2- dimensions array, initialize it to 0, then place the result of multiplication of two 1-dimension arrays as described in...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.