Report Control Source In Text to Count

In the VBA editor press Ctrl + G to bring it up. Very handy for testing things. The ? is used to "Print" the result.

You need to use the whole statement, not just a bit of it.

=Sum(IIf(VAL([LeadResult]) > 0.05,1,0))
Ok, I'm in the VBA and see the immediate window. I put the < ?"BRL">"0.05"> in the immediate window? and the whole statement goes where?
 
No, just going by the fact that the field had to hold BRL and that he was using "0.05" already. :)
0.05 is the threshhold for positive results. Anything below 0.05, including BRL, is negative.
 
I put <=Sum(IIf(Val([LeadResult])>0.05,1,0))> in the Control Source for the text box and

<?"BRL">"0.05"> in the Immediate Box in the VBA Editor.


"Data type mismatch in criteria expression"
 
The BRL > 0.05 is just to show you in text that BRL is > 0.05 if you leave it all as text.

From my Immediate window, where I always test small stuff
Code:
? "BRL" > "0.05"
True
? VAL("BRL")
0
? VAL(0.05)
0.05
? Val("BRL") > Val("0.05")
False

So I have no idea what you are doing? :(
Best upload a sample, we are up to 30 posts on such a simple matter already.

Also do not put < & > at the end of code. Confusing as hell, to me at least. If you have to put them there, make them bold so we know they are NOT part of the code.
 
Also do not put < & > at the end of code. Confusing as hell, to me at least. If you have to put them there, make them bold so we know they are NOT part of the code.
Got it.


The BRL > 0.05 is just to show you in text that BRL is > 0.05 if you leave it all as text.

From my Immediate window, where I always test small stuff
Code:
? "BRL" > "0.05"
True
? VAL("BRL")
0
? VAL(0.05)
0.05
? Val("BRL") > Val("0.05")
False

So I have no idea what you are doing? :(
Best upload a sample, we are up to 30 posts on such a simple matter already.

Also do not put < & > at the end of code. Confusing as hell, to me at least. If you have to put them there, make them bold so we know they are NOT part of the code.
Thanks @Gasman . I put your code in my immediate window. What do I do now?
 
No, the immediate window is to test something and to see output from any Debug.Print
I only keyed that to show you what the results are for each test.

You need to get to the bottom of why the posted code using Val still produces a Type Mismatch.
 
No, the immediate window is to test something and to see output from any Debug.Print
I only keyed that to show you what the results are for each test.

You need to get to the bottom of why the posted code using Val still produces a Type Mismatch.
Understood. Maybe I can post a sample tomorrow. The one I'm working with has sensitive data in it.
Thank you for your time.

No doubt @Pat Hartman is absolutely correct about the field. Maybe I can figure out a way to change BRL to a number.
 
Well the Val() should have solved that problem, or so I would have thought. :(

Look here for some code to hide the real data.
 

Users who are viewing this thread

Back
Top Bottom