Using a For Next Loop to add Fields to a Table

harrisw

Registered User.
Local time
Today, 07:28
Joined
Mar 27, 2001
Messages
131
I'm using the code below

For x = 1 To 10
DBase.Execute "ALTER TABLE Results ADD COLUMN TEST(x) TEXT;"
Next x

Keep getting syntax errors.

Any ideas?
 
try

DBase.Execute "ALTER TABLE Results ADD COLUMN TEST " & x & " TEXT"
 
Correction :
DBase.Execute "ALTER TABLE Results ADD COLUMN TEST" & x & " TEXT"
 

Users who are viewing this thread

Back
Top Bottom