We help IT Professionals succeed at work.
Get Started

Filter Property VBA

dailymeat
dailymeat asked
on
277 Views
Last Modified: 2016-02-10
I have a form "PriceListPrint" that has a field named "CategoryID" and command button to open a report "PriceListEnglish". In the form before the open report command there is this line: CategoryID="Rest"
In the report there is a subreport "PriceListBeef" that has 2 fields "CategoryIDRest" and
"CategoryIDRest2" I only want to show one or the other, not both, if I manually go into the subreport "PriceListBeef" in the Filter Property and write in either of the controls it works, When I tried to do it in code on the "On Load" of the subreport:
If Forms![PriceListPrint]![CategoryID]="Rest" then
Me.Filter=CategoryIDRest
Me.FilterOn=True
Else
Me.Filter=CategoryIDRest2
Me.FilterOn=True
End If
It gives this error "You Entered An Expression That Has No Value"
Comment
Watch Question
Infotrakker Software
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014
Commented:
This problem has been solved!
Unlock 1 Answer and 25 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE