Boolean to Text String

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
 
J

John Nurick

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", "")
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top