updating the first 6 records in a table

diversoln

Registered User.
Local time
Today, 08:22
Joined
Oct 8, 2001
Messages
119
After a series of queries, I'd like to export the resulting table to Excel to graph the data. I'd like to include a "descriptors" field in the table that show the settings that were used as criteria to form this table. I have six strings that I would like to reside in the "descriptors" field in the first six records of the table.

I'm thinking that I'd like to set up a loop that will update the records starting at the top of the file. Is there a way to do this ?

Thanks for any advice you can offer...
 
I've been working with this for a while and have come up with the following, but something is still missing - any ideas ?


Dim rst As Recordset
Dim strarray(6, 1) As String
Dim counter As Integer
Dim dbs As Database


strarray(1, 1) = str1
strarray(2, 1) = str2
strarray(3, 1) = str3
strarray(4, 1) = str4
strarray(5, 1) = str5
strarray(6, 1) = str6

counter = 1
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("All_WOs", dbOpenDynaset)

With rst
.MoveFirst

Do While counter < 7
.Edit
!descriptors = strarray(counter, 1)
counter = counter + 1
rst.MoveNext
Loop

End With
 
Thanks Pat - I agree that its the way to go
smile.gif


Have a great day.
 

Users who are viewing this thread

Back
Top Bottom