I need to use the following condition in the OnOpen event of the report
If Me![TxtMyCategory] = 6 Or 12 Then
........
But i get the error " you entered an expression that has no value"
I can evade the error if i put the expression in the OnFormat event.
But in the OnFormat event i cannot create the control source for the
following line :
Me![MyLiters].ControlSource = "=[liters] & "" kg"""
The above line works only in the OnOpen event,and not in the OnFormat event.
Thus i find myslef in a vicous circle and i cannot do my task.
Is there any possiblity to place the following code in the OnPen event :
If Me![TxtMyCategory] = 6 Or 12 Then
Me![MyLiters].ControlSource = "=[liters] & "" kg"""
Else
Me![MyLiters].ControlSource = "=[liters] & "" liters"""
End If
Just to explain why i need this code.
On each invoice, that may contain 12 products, i need to write kilograms or liters
depending on the category of the product contained in the MyCategory control.
So, for example if the category is 6 ,the products should be in kilograms.
Unfortunately i cannot achieve it. I will be grateful for any help.