G
Guest
I am attempting to change a queries' property (filter & filteron) before
running it, instead of constructing the whole query in code. I am
constructing for example 'discipline in ('AB','CD') - assigning this to a
string and trying to set the property one of two ways: (neither have
worked). I get a message indicating that the property cannot be found.
'CurrentDb.QueryDefs(stDocName).Properties("FilterOn") = True
myquery.Properties("FilterOn") = True ' Getting error on-cant find property
the filter property is also not found:
If y = 1 Then
WhereItem = "[Discipline] In (" & """" & MyDiscipline & """"
Else
WhereItem = WhereItem & ", " & """" & MyDiscipline & """"
End If
....
WhereItem = WhereItem & ") "
....
myquery.Properties("Filter") = WhereItem
I am noticing that whle the filter property appears available via the query
builder interface, it is not listed as a querydef property. IS there a way
to do this without re-constructing the whole SQL statement?
running it, instead of constructing the whole query in code. I am
constructing for example 'discipline in ('AB','CD') - assigning this to a
string and trying to set the property one of two ways: (neither have
worked). I get a message indicating that the property cannot be found.
'CurrentDb.QueryDefs(stDocName).Properties("FilterOn") = True
myquery.Properties("FilterOn") = True ' Getting error on-cant find property
the filter property is also not found:
If y = 1 Then
WhereItem = "[Discipline] In (" & """" & MyDiscipline & """"
Else
WhereItem = WhereItem & ", " & """" & MyDiscipline & """"
End If
....
WhereItem = WhereItem & ") "
....
myquery.Properties("Filter") = WhereItem
I am noticing that whle the filter property appears available via the query
builder interface, it is not listed as a querydef property. IS there a way
to do this without re-constructing the whole SQL statement?