Transfer data

johnob

Registered User.
Local time
Today, 23:20
Joined
Jan 12, 2014
Messages
45
Hi all,

Below is the formula that I'm trying to get a value from an other Form (Pump Settings). But I keep getting an error message . :banghead:

=IIf([Result1]<4.1,0,IIf([Result1]>6.5,([Result1]-[Pump Settings]![Target ]),IIf([Result1]>4<6.5,1,"")))


Can anyone help ?

Thanks
 
"an error message" any chance you want to
1) Share it
2) use the code tags when you post any code (# button in the post menu)
3) Keep or make your code readable when you post is
Code:
=IIf([Result1]<4.1,0
,IIf([Result1]>6.5,([Result1]-[Pump Settings]![Target ])
,IIf([Result1]>4<6.5,1
,"")))
from this I can see atleast 2 problems, probably 3... can you?
 
=IIf([Result1]<4.1,0,
IIf([Result1]>6.5,([Result1]-[Pump Settings]![Target]),
IIf([Result1]>4<6.5,1,"")))

1) from that I would say that there should be 4 brackets not 3, but with 4 i get an error
2) the part ([Result1]-[Pump Settings]![Target]) should not be in brackets

the formula works if you change it to . IIf([Result1]>6.5,([Result1]-7),

but I need target value from Pump Settings
 
2 definate mistakes I can see:
1)
,IIf([Result1]>4<6.5,1
That isnt proper syntax for what you are trying to do
,IIf([Result1]>4 or [result1]<6.5,1
Would be the proper syntax

2)
the results, you are mixing string and number value returns... that should all be one type either strings or numbers. Try doing Null instead of ""

3)
The control name [Target ] , are you sure that space blongs there? It just looks wrong and if you put the space there on purpose I suggest you remove it cause it is a problem waiting to happen

4) What ever happened to you using the code tags?
 
4) What ever happened to you using the code tags?

With a total of 4 posts I would imagine the reply would be - What?

=================================

johnob ...

Putting your code in the appropriate tags makes it easier to read.

Private Sub codeWithoutTags()
' This is code without tags
End Sub

As opposed to

Code:
[b][[/b]code[b]][/b]Private Sub codeWithTags()
  ' This is code with tags
End Sub[b][[/b]/code[b]][/b]

You can either select the code and press the hash (#) button, in the menu group above the main editing box, or press the button first and type the code between the [code] and [/code] tags.
 
Last edited:
nanscombe, thanks for that, though I did describe it in my earlier post :)
 

Users who are viewing this thread

Back
Top Bottom