Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding dynamic array values to a table

Status
Not open for further replies.

ibgary

MIS
May 24, 2001
6
0
0
US
I have an array [results], that may be up to 25 cells long. I want to save the values in the cells to a new record in a table [ManyWords].

The problem is when I hard code saving the values (word0 = results(0), word1 = results(1), etc) I get a "script out of range" message as the array runs out of values. I tried the following code but the variables don't seem to be recognized;

With rstwords
.AddNew
N = 0 'Local variable
While N < UBound(result) 'result is the name of the array variable
mword = &quot;.word&quot; & N 'Local variable
mresult = &quot;result(&quot; & N & &quot;)&quot; 'Local variable
[mword] = [mresult] 'This line is not working
N = N + 1
Wend
.Update
End With

Does anyone know why access97 is not pulling the result() array values and saving them to the table?

Thanks in advance for any insight you can provide....
 
Try placing a &quot;.&quot; or a &quot;!&quot; in front of your fields.

Gary
gwinn7
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top