G
Guest
Using Access 2003
I want to be able to use varables to refer to query column headings so that
I can use user input to decide which columns appear on a report.
For example:
rstT is based on a table, rstQ on a query (crosstab)
I have found that:
rstT!Field1 = rstQ!assess1 'this works - assess1 is a column in the query)
But
Dim strField As String
strField = "assess1"
rstT!Field1 = rstQ!strField 'does not work (item not found in this
collection)
Is there a way to to make something like this work? I have tried various
combinations of [], " & & " etc
I want to be able to use varables to refer to query column headings so that
I can use user input to decide which columns appear on a report.
For example:
rstT is based on a table, rstQ on a query (crosstab)
I have found that:
rstT!Field1 = rstQ!assess1 'this works - assess1 is a column in the query)
But
Dim strField As String
strField = "assess1"
rstT!Field1 = rstQ!strField 'does not work (item not found in this
collection)
Is there a way to to make something like this work? I have tried various
combinations of [], " & & " etc