I have a very useful report that works fine,i just want to improve it.In short,i want for the report to show only those products, that have the field branch > 0.It is very difficult fo me to do it, since the code i use is very powerful,but does not allow using a query.Otherwise the query might have solved the problem.
Just to explain how the code works.The Report is based on the table products.The table products contains the stock for each city, under the common name branch.
For example the stock for city 1 is branch0
the stock for city 2 is branch1
the stock for city 3 is branch2
etc etc.
Therefore by choosing the city, in the form Benchmark,and the option control office,i get
Bestand.ControlSource = ("branch" & (Forms!FBenchmark!Office - 1))
Here is the whole code in the OnOpen event of my report:
If IsNull(Forms![FBenchmark]![Office]) Then
DoCmd.Beep
Exit Sub
Else
Me![heading].Caption = Branching
Dim Bestand As Control
Set Bestand = Me![Bestand]
Dim Stueck As Control
Set Stueck = Me![Stueck]
Bestand.ControlSource = ("branch" & (Forms!FBenchmark!Office - 1))
Stueck.ControlSource = "items" & (Forms!FBenchmark!Office - 1)
End If
Me![heading].Caption = Branching
The report works fine,it is very elegant, but shows all the products,even products that have branch = 0, and this makes a
long list. How can i show only the products, that have branch> 0 ?



