My Assistant
![]() ![]() |
|
|
May 30 2012, 10:02 AM
Post
#1
|
|
|
New Member Posts: 2 |
Hi,
I have read all I can find on using a combobox to filter a subreport, but can't seem to get a handle on the exact syntax for the subreport control in the setfilter action. I've tried so many combinations, and nothing seems to work. In the forum examples, I can't find same example with that part typed in the because it's probably so obvious, but I'm stuck. I have a horizontal tabbed navigation form. In one of the tabbed pages there is a combobox and a subreport. The combobox is the filter for the subreport. In the afterupdate event of the combobox, I have the following macro:
filter_macro.jpg ( 13.34K )
Number of downloads: 12. I tried changing the action to 'openreport' with the same filter part but using the report name, and the report opens appropriately filtered. So, I assume the filter part is correct, and the control name for the subreport is incorrectly referenced. For all I have tried (all kinds of forms!.... references attempts), I keep getting an error "The SetFilter' action requires a valid control name that corresponds to a subform." The control name for the subreport is "rptSub". Is anyone able to point out what I need to type in for control name? I sure would appreciate it! Laura |
|
|
|
May 30 2012, 06:04 PM
Post
#2
|
|
|
UtterAccess Veteran Posts: 474 From: Sydney, Australia |
Hi Laura
I could not make out from your post the exact fields you are referring to. Perhaps this will help explain Referring to a subform |
|
|
|
May 30 2012, 08:04 PM
Post
#3
|
|
|
UtterAccess Addict Posts: 274 |
You need to use the BrowseTo function in the Macro. I recommend downloading the Northwinds web database and look at how it is done.
Bonnie |
|
|
|
May 31 2012, 11:16 PM
Post
#4
|
|
|
New Member Posts: 2 |
THANKS, Bonnie!!! It FINALLY works...browseto did it! Very grateful.
Neville, I really like the "referring to a subform". while i confess to using a cheat sheet in VBA at times, this one is much better because i could read the narrative and understand why it is the way it is. Maybe I'll eventually be able to dump the cheat 'cuz it will be so obvious to me. What would I do without the forums and people helping me directly or indirectly by helping others so I can learn from them! |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 18th May 2013 - 02:14 PM |