R
Rus925
I have VB code for a query, but I don't know how to turn it into an actual
query. Any advice? Thanks!
Here's the basic code (from
http://www.microsoft.com/office/com...c98740-7291-4c87-999b-e25f0b53bfeb&sloc=en-us):
Dim str AS string
str= " SELECT "
if check1 then str=str & " field1,"
if check2 then str = str & " field2,"
....
' remove the extra coma ( I assume at least ONE field will be selected)
str=Left(str, len(str)-1)
'complete the statement
str= str & " FROM tableName ... "
'use the string a record source (form/report) or row source (combo box,
list box)
query. Any advice? Thanks!
Here's the basic code (from
http://www.microsoft.com/office/com...c98740-7291-4c87-999b-e25f0b53bfeb&sloc=en-us):
Dim str AS string
str= " SELECT "
if check1 then str=str & " field1,"
if check2 then str = str & " field2,"
....
' remove the extra coma ( I assume at least ONE field will be selected)
str=Left(str, len(str)-1)
'complete the statement
str= str & " FROM tableName ... "
'use the string a record source (form/report) or row source (combo box,
list box)