View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
parkin_m parkin_m is offline
external usenet poster
 
Posts: 8
Default Simple i think.... breaking SQL

Made it simpler to read below:

'This works
Set rs = db.OpenRecordset("SELECT description FROM" & selectTable)

'Trying to get it so that i can put the column name from a variable
Dim i As String
i= "description"

'none of these work
'Set rs = db.OpenRecordset("SELECT" i " FROM" & selectTable)
'Set rs = db.OpenRecordset("SELECT' i ' FROM" & selectTable)
'Set rs = db.OpenRecordset("SELECT" & i " FROM" & selectTable)

im sure the fix is very simple, thanks in advance