E
ernestb08
In the following code I want for 'x' to be read as a variable (change
dynamically) in the sql statements, but it reads it as a character.
by the time the loop runs for the second it tells me that table x has
already been created.
I want for 'x' inside the sql statement to incremently change by 1
every time the loop runs. the FOR loop syntax is o.k., but maybe the
reason why it doesn't work is because everything is in parenthesis. I
need to let the interpreter know that 'x' inside the parenthesis is a
variable not a character.
Any ideas?
'X' will eventually be arund 4132.
Dim x As Integer
Dim i As Integer
'i = 5
'For x = 3 To i Step 1
Dim strSQL01 As String
strSQL01 = " CREATE TABLE x ( OBJECTID number not null,uniqueID number,
Point_X Number, Point_Y Number);"
CurrentDb.Execute strSQL01
Dim strSQL02 As String
strSQL02 = " INSERT INTO x SELECT OBJECTID, uniqueID, Point_X, Point_Y
FROM Vertices WHERE ((([Vertices].[UniqueID]) = 01)) ORDER BY
[Vertices].[UniqueID], [Vertices].[OBJECTID];"
CurrentDb.Execute strSQL02
'Next x
dynamically) in the sql statements, but it reads it as a character.
by the time the loop runs for the second it tells me that table x has
already been created.
I want for 'x' inside the sql statement to incremently change by 1
every time the loop runs. the FOR loop syntax is o.k., but maybe the
reason why it doesn't work is because everything is in parenthesis. I
need to let the interpreter know that 'x' inside the parenthesis is a
variable not a character.
Any ideas?
'X' will eventually be arund 4132.
Dim x As Integer
Dim i As Integer
'i = 5
'For x = 3 To i Step 1
Dim strSQL01 As String
strSQL01 = " CREATE TABLE x ( OBJECTID number not null,uniqueID number,
Point_X Number, Point_Y Number);"
CurrentDb.Execute strSQL01
Dim strSQL02 As String
strSQL02 = " INSERT INTO x SELECT OBJECTID, uniqueID, Point_X, Point_Y
FROM Vertices WHERE ((([Vertices].[UniqueID]) = 01)) ORDER BY
[Vertices].[UniqueID], [Vertices].[OBJECTID];"
CurrentDb.Execute strSQL02
'Next x