Hello all,

I hope somebody can help me out.

In my code the SQL column name is a variable.
The columns are named: KWR1, KWR1, KWR3 and KWR4 (where I use a variable for the number (mytel2))
The choice is made in an userform (4 choices).
Afterwards I would like to copy the data from one of the columns in a range.
Below is the code I have, so far, but get an error at: Range("A" & mytel2) = rc![" & kolom & "]


...
kolom = "KWR" & mytel

rc.Open "SELECT [" & kolom & "] FROM " & jaar & " WHERE [" & kolom & "] != ''", con
rc.MoveFirst

Do
Range("A" & mytel2) = rc![" & kolom & "]
mytel2 = mytel2 + 1
rc.MoveNext
Loop Until rc.EOF

rc.Close
...