conditional formatting

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Howdy!

I have a field called ‘Alt_Serving_Size’ which contains the following data
in grams:

92
114±14
etc

I have the following command in the control source:

="The serving size for " & [Food_Name] & " shall be " & [Serving_Size] & " "
& [Units] & " (approximately " & [Alt_Serving_Size] & " grams)."

This puts the word ‘approximately†before the no. such as:

approximately 92 grams
approximately 114±14 grams

However, I do not want the word ‘approximately’ to appear if the value has
a positive and minus signs (±) such as 114±14.

Any help is greatly appreciated. TIA!
 
Hi,
You can try putting an IIF statement at the end of your line something
like:

="The serving size for " & [Food_Name] & " shall be " & [Serving_Size] & " "
& [Units] & IIF(instr(alt_serving_size),"+/-",alt_serving_size, "
approximately " & alt_serving_size)
 
Thanks for your reply Chris. I have entered the following expression"

="The serving size for " & [Food_Name] & " shall be " & [Serving_Size] & " "
& [Units] & IIF(InStr(Alt_Serving_Size,"±",Alt_Serving_Size, " (approximately
"& Alt_Serving_Size & " grams)."))

It gave me this error mesage: "The expression you entered has a function
containing the wrong number of arguments".

Any ideas? Thanks again!


Chris said:
Hi,
You can try putting an IIF statement at the end of your line something
like:

="The serving size for " & [Food_Name] & " shall be " & [Serving_Size] & " "
& [Units] & IIF(instr(alt_serving_size),"+/-",alt_serving_size, "
approximately " & alt_serving_size)

user said:
Howdy!

I have a field called ‘Alt_Serving_Size’ which contains the following data
in grams:

92
114±14
etc

I have the following command in the control source:

="The serving size for " & [Food_Name] & " shall be " & [Serving_Size] & " "
& [Units] & " (approximately " & [Alt_Serving_Size] & " grams)."

This puts the word ‘approximately†before the no. such as:

approximately 92 grams
approximately 114±14 grams

However, I do not want the word ‘approximately’ to appear if the value has
a positive and minus signs (±) such as 114±14.

Any help is greatly appreciated. TIA!
 
Wow, I was way tired when I answered - gave you wrong syntax. See if you
have better luck with this:

="The serving size for " & [Food_Name] & " shall be " & [Serving_Size] & " "
& [Units] & IIF(InStr(Alt_Serving_Size,"±") > 0 , Alt_Serving_Size, "
approximately " & Alt_Serving_Size & " grams)

user said:
Thanks for your reply Chris. I have entered the following expression"

="The serving size for " & [Food_Name] & " shall be " & [Serving_Size] & " "
& [Units] & IIF(InStr(Alt_Serving_Size,"±",Alt_Serving_Size, " (approximately
"& Alt_Serving_Size & " grams)."))

It gave me this error mesage: "The expression you entered has a function
containing the wrong number of arguments".

Any ideas? Thanks again!


Chris said:
Hi,
You can try putting an IIF statement at the end of your line something
like:

="The serving size for " & [Food_Name] & " shall be " & [Serving_Size] & " "
& [Units] & IIF(instr(alt_serving_size),"+/-",alt_serving_size, "
approximately " & alt_serving_size)

user said:
Howdy!

I have a field called ‘Alt_Serving_Size’ which contains the following data
in grams:

92
114±14
etc

I have the following command in the control source:

="The serving size for " & [Food_Name] & " shall be " & [Serving_Size] & " "
& [Units] & " (approximately " & [Alt_Serving_Size] & " grams)."

This puts the word ‘approximately†before the no. such as:

approximately 92 grams
approximately 114±14 grams

However, I do not want the word ‘approximately’ to appear if the value has
a positive and minus signs (±) such as 114±14.

Any help is greatly appreciated. TIA!
 
Thanks again for your reply.

I tried the following expression but it gave me syntax error.

="The serving size for " & [Food_Name] & " shall be " & [Serving_Size] & " "
& [Units] & IIF(InStr(Alt_Serving_Size,"±") > 0 , Alt_Serving_Size, "
(approximately " & Alt_Serving_Size & " grams).â€)

Thank you for your patience!

Chris said:
Wow, I was way tired when I answered - gave you wrong syntax. See if you
have better luck with this:

="The serving size for " & [Food_Name] & " shall be " & [Serving_Size] & " "
& [Units] & IIF(InStr(Alt_Serving_Size,"±") > 0 , Alt_Serving_Size, "
approximately " & Alt_Serving_Size & " grams)

user said:
Thanks for your reply Chris. I have entered the following expression"

="The serving size for " & [Food_Name] & " shall be " & [Serving_Size] & " "
& [Units] & IIF(InStr(Alt_Serving_Size,"±",Alt_Serving_Size, " (approximately
"& Alt_Serving_Size & " grams)."))

It gave me this error mesage: "The expression you entered has a function
containing the wrong number of arguments".

Any ideas? Thanks again!


Chris said:
Hi,
You can try putting an IIF statement at the end of your line something
like:

="The serving size for " & [Food_Name] & " shall be " & [Serving_Size] & " "
& [Units] & IIF(instr(alt_serving_size),"+/-",alt_serving_size, "
approximately " & alt_serving_size)

:

Howdy!

I have a field called ‘Alt_Serving_Size’ which contains the following data
in grams:

92
114±14
etc

I have the following command in the control source:

="The serving size for " & [Food_Name] & " shall be " & [Serving_Size] & " "
& [Units] & " (approximately " & [Alt_Serving_Size] & " grams)."

This puts the word ‘approximately†before the no. such as:

approximately 92 grams
approximately 114±14 grams

However, I do not want the word ‘approximately’ to appear if the value has
a positive and minus signs (±) such as 114±14.

Any help is greatly appreciated. TIA!
 
Hi. I wonder if it's the double quote that is right at the end of your
statement? It looks different from all the rest.

user said:
Thanks again for your reply.

I tried the following expression but it gave me syntax error.

="The serving size for " & [Food_Name] & " shall be " & [Serving_Size] & " "
& [Units] & IIF(InStr(Alt_Serving_Size,"±") > 0 , Alt_Serving_Size, "
(approximately " & Alt_Serving_Size & " grams).â€)

Thank you for your patience!

Chris said:
Wow, I was way tired when I answered - gave you wrong syntax. See if you
have better luck with this:

="The serving size for " & [Food_Name] & " shall be " & [Serving_Size] & " "
& [Units] & IIF(InStr(Alt_Serving_Size,"±") > 0 , Alt_Serving_Size, "
approximately " & Alt_Serving_Size & " grams)

user said:
Thanks for your reply Chris. I have entered the following expression"

="The serving size for " & [Food_Name] & " shall be " & [Serving_Size] & " "
& [Units] & IIF(InStr(Alt_Serving_Size,"±",Alt_Serving_Size, " (approximately
"& Alt_Serving_Size & " grams)."))

It gave me this error mesage: "The expression you entered has a function
containing the wrong number of arguments".

Any ideas? Thanks again!


:

Hi,
You can try putting an IIF statement at the end of your line something
like:

="The serving size for " & [Food_Name] & " shall be " & [Serving_Size] & " "
& [Units] & IIF(instr(alt_serving_size),"+/-",alt_serving_size, "
approximately " & alt_serving_size)

:

Howdy!

I have a field called ‘Alt_Serving_Size’ which contains the following data
in grams:

92
114±14
etc

I have the following command in the control source:

="The serving size for " & [Food_Name] & " shall be " & [Serving_Size] & " "
& [Units] & " (approximately " & [Alt_Serving_Size] & " grams)."

This puts the word ‘approximately†before the no. such as:

approximately 92 grams
approximately 114±14 grams

However, I do not want the word ‘approximately’ to appear if the value has
a positive and minus signs (±) such as 114±14.

Any help is greatly appreciated. TIA!
 
Hi. I checked the field names and retyped everything but no joy. I also
simplified the expression as follows for testing but it still gave me invalid
syntax:

=IIF(InStr(Alt_Serving_Size,"±") > 0, Alt_Serving_Size, Food_Name)

Thanks again!


Chris said:
Hi. I wonder if it's the double quote that is right at the end of your
statement? It looks different from all the rest.

user said:
Thanks again for your reply.

I tried the following expression but it gave me syntax error.

="The serving size for " & [Food_Name] & " shall be " & [Serving_Size] & " "
& [Units] & IIF(InStr(Alt_Serving_Size,"±") > 0 , Alt_Serving_Size, "
(approximately " & Alt_Serving_Size & " grams).â€)

Thank you for your patience!

Chris said:
Wow, I was way tired when I answered - gave you wrong syntax. See if you
have better luck with this:

="The serving size for " & [Food_Name] & " shall be " & [Serving_Size] & " "
& [Units] & IIF(InStr(Alt_Serving_Size,"±") > 0 , Alt_Serving_Size, "
approximately " & Alt_Serving_Size & " grams)

:

Thanks for your reply Chris. I have entered the following expression"

="The serving size for " & [Food_Name] & " shall be " & [Serving_Size] & " "
& [Units] & IIF(InStr(Alt_Serving_Size,"±",Alt_Serving_Size, " (approximately
"& Alt_Serving_Size & " grams)."))

It gave me this error mesage: "The expression you entered has a function
containing the wrong number of arguments".

Any ideas? Thanks again!


:

Hi,
You can try putting an IIF statement at the end of your line something
like:

="The serving size for " & [Food_Name] & " shall be " & [Serving_Size] & " "
& [Units] & IIF(instr(alt_serving_size),"+/-",alt_serving_size, "
approximately " & alt_serving_size)

:

Howdy!

I have a field called ‘Alt_Serving_Size’ which contains the following data
in grams:

92
114±14
etc

I have the following command in the control source:

="The serving size for " & [Food_Name] & " shall be " & [Serving_Size] & " "
& [Units] & " (approximately " & [Alt_Serving_Size] & " grams)."

This puts the word ‘approximately†before the no. such as:

approximately 92 grams
approximately 114±14 grams

However, I do not want the word ‘approximately’ to appear if the value has
a positive and minus signs (±) such as 114±14.

Any help is greatly appreciated. TIA!
 
It is working now, I do not know what happened. Thank you so much for your
patience and help!!

user said:
Hi. I checked the field names and retyped everything but no joy. I also
simplified the expression as follows for testing but it still gave me invalid
syntax:

=IIF(InStr(Alt_Serving_Size,"±") > 0, Alt_Serving_Size, Food_Name)

Thanks again!


Chris said:
Hi. I wonder if it's the double quote that is right at the end of your
statement? It looks different from all the rest.

user said:
Thanks again for your reply.

I tried the following expression but it gave me syntax error.

="The serving size for " & [Food_Name] & " shall be " & [Serving_Size] & " "
& [Units] & IIF(InStr(Alt_Serving_Size,"±") > 0 , Alt_Serving_Size, "
(approximately " & Alt_Serving_Size & " grams).â€)

Thank you for your patience!

:

Wow, I was way tired when I answered - gave you wrong syntax. See if you
have better luck with this:

="The serving size for " & [Food_Name] & " shall be " & [Serving_Size] & " "
& [Units] & IIF(InStr(Alt_Serving_Size,"±") > 0 , Alt_Serving_Size, "
approximately " & Alt_Serving_Size & " grams)

:

Thanks for your reply Chris. I have entered the following expression"

="The serving size for " & [Food_Name] & " shall be " & [Serving_Size] & " "
& [Units] & IIF(InStr(Alt_Serving_Size,"±",Alt_Serving_Size, " (approximately
"& Alt_Serving_Size & " grams)."))

It gave me this error mesage: "The expression you entered has a function
containing the wrong number of arguments".

Any ideas? Thanks again!


:

Hi,
You can try putting an IIF statement at the end of your line something
like:

="The serving size for " & [Food_Name] & " shall be " & [Serving_Size] & " "
& [Units] & IIF(instr(alt_serving_size),"+/-",alt_serving_size, "
approximately " & alt_serving_size)

:

Howdy!

I have a field called ‘Alt_Serving_Size’ which contains the following data
in grams:

92
114±14
etc

I have the following command in the control source:

="The serving size for " & [Food_Name] & " shall be " & [Serving_Size] & " "
& [Units] & " (approximately " & [Alt_Serving_Size] & " grams)."

This puts the word ‘approximately†before the no. such as:

approximately 92 grams
approximately 114±14 grams

However, I do not want the word ‘approximately’ to appear if the value has
a positive and minus signs (±) such as 114±14.

Any help is greatly appreciated. TIA!
 
Back
Top