K
KarenH
I am trying to fun a query based on something a user selects from a listbox,
and I am trying to use ApplyFilter to set that criteria.
I have the following code:
DoCmd.ApplyFilter , "[BU] = '" & strBUFilter & "'"
DoCmd.OpenQuery gstrQueryNameSelected
The query has been assigned to the gstrQueryNameSelected variable, and
strBUFilter is set to the BU selected from the list.
I get the following error: "The action or method is invalid because the
form or report isn't bound to a table or query." I tried putting the
applyfilter statement after the openquery statement, and got the same error
message.
What am I doing wrong? Thanks in advance.
and I am trying to use ApplyFilter to set that criteria.
I have the following code:
DoCmd.ApplyFilter , "[BU] = '" & strBUFilter & "'"
DoCmd.OpenQuery gstrQueryNameSelected
The query has been assigned to the gstrQueryNameSelected variable, and
strBUFilter is set to the BU selected from the list.
I get the following error: "The action or method is invalid because the
form or report isn't bound to a table or query." I tried putting the
applyfilter statement after the openquery statement, and got the same error
message.
What am I doing wrong? Thanks in advance.