Creating or modifying a table with code

simongallop

Registered User.
Local time
Today, 23:13
Joined
Oct 17, 2000
Messages
611
I have a query that will return any thing between 40 and 127 rows. This needs to be translated to a table with 40 to 127 columns ie 1 column per row.

Having created this I need the new columns to be YES/NO. Filling the YES/NO boxes in code I can do but I do not know where to start to build a table based on a variable piece of information.

Having done this, I will then need to build 3 queries with the same structure as the new table though I think that I have worked out a way of doing that by using MyStr = MyStr & "['" & MyVar & "] as etc.. ie loopingthrough to build up the query SQL

Can anyone help or point me in the right direction

Thanks in advance

Harry
 
Problem Solved!!


For Count = 57 To 61
NewCols = NewCols & Count & " YesNo, "
Next
NewCols = Left(NewCols, Len(NewCols) - 2)

CreateString = "CREATE TABLE NewTable (" & NewCols & ");"
CurrentDb.Execute CreateString

As a fixed version.
 

Users who are viewing this thread

Back
Top Bottom