Variable declared as Double not recognized in formula

4 posts / 0 new
Last post
Pawelski_33
Offline
Joined: 06/05/2018 - 12:16
Variable declared as Double not recognized in formula

 
Hi All,
In my piece of code I declare value for IPT rate and then use that variable in the formula (contain within criteria of my IPT_Validation function) however it fails claiming the equation is bad.
CODE:
Function IPT_Validation(MasterDb As Object, UserChoice() As String)
Dim IPTRate As Double
IPTRate = 0.125
'Extracting all data
Set TargetDb = MasterDb
Call Extraction_All_And_Export(TargetDb, "Unusual IPT rate", "@Abs(" & UserChoice(8) & ") <>0.125")
End Function
It only works with value 0.125 in the criteria formula and not with the IPTRate variable declared at the top of the fuction.
How can I twick it please?
 

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

What was your original equation that wasn't working?

Here is the equation that works for me based on your variables:

"@abs(" & UserChoice(8)  & ") <> " & IPTRate

Pawelski_33
Offline
Joined: 06/05/2018 - 12:16

Ace.Thanks Brian
My previous version was missing apersand:
Call Extraction_All_And_Export(TargetDb, "Unusual IPT rate", "@Abs(" & UserChoice(8) & ") <>" IPTRate) ...
 
 

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

No problem, it is those small things that alwasy get you.