I have a form based on my transactions table, which has an 'account' combo box in the header to filter the transactions based on the selected accounts.
I used the new Actions (or Macro Actions) to setup the filter, which is basically:
SetTempVar (Name: CurrentAccountId, Expression: [screen].[activecontrol]
ApplyFilter (Where: [Account] = [TempVars]![CurrentAccountId]
RemoveTempVar (Name: CurrentAccountId)
This works very well if the form is loaded by itself, but as soon as I load the form in a navigation form (form with tabs on top and left) and I use the filter again 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 checked online and some posts refer to the SelectObject action which didn't work. It threw another error. Here's what I did (I added a step before step 2 above):
SelectObject (Object Type: form, Object Name: Transactions List, In Database Window: no)
The error I received is:
The object Transactions List isn't open.
The combo box list with my accounts is on the form where this filtering should occur, so:
- I'm not sure why my first approach works in the form window when it's loaded by itself
- Why would it throw an error in a navigation window