Boolean to Text String

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

Guest

Hi,
I have three boolean (yes/no) fields in my table to indicate how an order
was submitted, by phone and/or fax and/or email. I have also added a text
field in the table called submitted. In my form, I want build a text string
into the "submitted" field with the words "phone " concatenated with "fax "
concatenated with "email " corresponding to which radio buttons they check
off on the form. Then I can display this text field on the respective
reports. What's the bext approach. Thanks!

Howard
 
Hi Howard,

You don't need the Submitted field, because you can always generate your
text string from the other fields as and when needed, typically with a
calculated field in a query or an expression in a textbox in a report.

Assuming the fields are called ByPhone, ByFax and ByEmail, it would be
like this:

Calculated field in query:

Submitted: IIF([ByPhone], "Phone ", "") & IIF([ByFax], "Fax ", "") &
IIF([ByEmail], "Email", "")

Expression:

=IIF([ByPhone], "Phone ", "") & IIF([ByFax], "Fax ", "") &
IIF([ByEmail], "Email", "")
 
Hi John,

Great advise. Worked perfectly as a calculated field in my queries. Thanks
for everything. Much appreciated!

Howard Freedman

John Nurick said:
Hi Howard,

You don't need the Submitted field, because you can always generate your
text string from the other fields as and when needed, typically with a
calculated field in a query or an expression in a textbox in a report.

Assuming the fields are called ByPhone, ByFax and ByEmail, it would be
like this:

Calculated field in query:

Submitted: IIF([ByPhone], "Phone ", "") & IIF([ByFax], "Fax ", "") &
IIF([ByEmail], "Email", "")

Expression:

=IIF([ByPhone], "Phone ", "") & IIF([ByFax], "Fax ", "") &
IIF([ByEmail], "Email", "")


Hi,
I have three boolean (yes/no) fields in my table to indicate how an order
was submitted, by phone and/or fax and/or email. I have also added a text
field in the table called submitted. In my form, I want build a text string
into the "submitted" field with the words "phone " concatenated with "fax "
concatenated with "email " corresponding to which radio buttons they check
off on the form. Then I can display this text field on the respective
reports. What's the bext approach. Thanks!

Howard
 
Back
Top