scifibum
Well-known Member
- Joined
- Jul 22, 2004
- Messages
- 503
Hi,
I've got an external data range (query table) on a worksheet that gets it's one parameter from a worksheet cell, and refreshes automatically when the parameter cell changes.
Everything works great when I enter the parameters by pasting or typing them in. If the parameter doesn't match any records in the database, then the query returns a blank result just as it should.
I tried setting up an ActiveX Combo Box control to let me select different parameter values from the drop down. The control is linked to the parameter cell, so when i make the selection, the cell value changes, and the query refreshes.
This works OK except for one thing. When I use the combo box to select a parameter value that does not have any matching records, the query does not refresh. It just sits there if I have background refresh enabled, and if I do not have this enabled then I get an error message:
"The following data range failed to refresh: Query from MS Access Database. Continue to refresh all?"
So I tried a couple of things and eventually I figured out that if I use code to update the parameter, I can select a worksheet cell before I change the parameter value (so the combo box is no longer selected), then it works and returns a blank result when there are no matching records.
What I can't figure out is why the behavior should be different when the control is selected vs. when it's not. As long as the combo box is not selected when the parameter value is updated, then it works.
Just thought I'd see if anyone had an explanation. I suspect it's a bug, but maybe I just can't understand why this is a feature.
Thanks in advance.
I've got an external data range (query table) on a worksheet that gets it's one parameter from a worksheet cell, and refreshes automatically when the parameter cell changes.
Everything works great when I enter the parameters by pasting or typing them in. If the parameter doesn't match any records in the database, then the query returns a blank result just as it should.
I tried setting up an ActiveX Combo Box control to let me select different parameter values from the drop down. The control is linked to the parameter cell, so when i make the selection, the cell value changes, and the query refreshes.
This works OK except for one thing. When I use the combo box to select a parameter value that does not have any matching records, the query does not refresh. It just sits there if I have background refresh enabled, and if I do not have this enabled then I get an error message:
"The following data range failed to refresh: Query from MS Access Database. Continue to refresh all?"
So I tried a couple of things and eventually I figured out that if I use code to update the parameter, I can select a worksheet cell before I change the parameter value (so the combo box is no longer selected), then it works and returns a blank result when there are no matching records.
What I can't figure out is why the behavior should be different when the control is selected vs. when it's not. As long as the combo box is not selected when the parameter value is updated, then it works.
Just thought I'd see if anyone had an explanation. I suspect it's a bug, but maybe I just can't understand why this is a feature.
Thanks in advance.