473,499 Members | 1,494 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

A97: What's a workable substitute for Dim Thing(0 to intMyCount)?

MLH
How can I accomplish what I'm obviously trying to
do below in a Sub procedure?

Select Case CustomerCount
Case Is < 10
Dim My_Targets(0 To 10) As String
Case Is < 50
Dim My_Targets(0 To 50) As String
Case Is < 100
Dim My_Targets(0 To 100) As String
Case Is < 200
Dim My_Targets(0 To 200) As String
Case Is < 400
Dim My_Targets(0 To 400) As String
End Select

The array declaration won't accept a variable. I don't KNOW
what the upper bound is, so I have to do a recordcount and
assign it to a variable. VBA seems to think I'm trying to Dim
the array 5 different times. Of course, I'm not. If its unclear
what I wanna do, will try to elaborate.
Oct 11 '06 #1
2 1244
ReDim Statement
Used at procedure level to reallocate storage space for dynamic array
variables.

Syntax

ReDim [Preserve] varname(subscripts) [As type] [, varname(subscripts)
[As type]] . . .

The ReDim statement syntax has these parts:
.....
straight out of the help file. You can even get to it by searching on
Dim... How 'bout that?

dim the array to whatever size (probably small) then redim it when you
know how big the array really needs to be.

Oct 11 '06 #2
On 11 Oct 2006 16:21:02 -0700, pi********@hotmail.com wrote:

And when you're done clean up such dynamic memory with the Erase
statement.
-Tom.
>ReDim Statement
Used at procedure level to reallocate storage space for dynamic array
variables.

Syntax

ReDim [Preserve] varname(subscripts) [As type] [, varname(subscripts)
[As type]] . . .

The ReDim statement syntax has these parts:
....
straight out of the help file. You can even get to it by searching on
Dim... How 'bout that?

dim the array to whatever size (probably small) then redim it when you
know how big the array really needs to be.
Oct 12 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1158
by: Douglas Buchanan | last post by:
I cannot create a database. (A97) Not with *any* name I try! I get the following error: ====================== Microsoft Access ---------------------- The Database 'C:\Documents and...
22
2298
by: Bradley | last post by:
Has anyone else noticed this problem? I converted the back-end to A2000 and the performance problem was fixed. We supply a 97 and 2000 version of our software so we kept the backend in A97 to make...
6
2235
by: David W. Fenton | last post by:
Is MS Graph really completely useless in Access 97? I uninstalled and re-installed to get the Office 97 version of MS Graph, but I see no way whatsoever to insert dynamic data into the chart....
2
2389
by: MLH | last post by:
What's the simplest way to allow a user of an A97 app to change password?
3
1465
by: MLH | last post by:
I wish to give user a tool to select period of car purchase. (IE, the block of time within which sale made) So, I'm gonna give him an option-group of choices like... this week this month last...
6
2871
by: MLH | last post by:
I was able to do this from Access 2.0. It had to be set up, of course, but it could be done. I'm unsure as to why Access 97 says "Can't find file"??? ...
16
1636
by: MLH | last post by:
I have 800 rows in a table named tbl800CircleDataPoints. There are two number fields named and in the table. Both are number (single) Type fields. The data points in the field range from -2...
2
2238
by: MLH | last post by:
What's the best technique to remove a value entered into a form's textbox control after halting the update of the textbox with a docmd.cancelevent line in a before update event procedure? IE,...
18
1760
by: MLH | last post by:
I have an A97 app that automatically sends eMail using OutLook Express. Each installation requires the user to reconfigure Outlook Express to avoid prompts waiting for them to authorize or deny...
0
7130
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7171
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7220
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5468
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4918
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4599
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3090
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
664
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.