Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / March 2006

Tip: Looking for answers? Try searching our database.

Boolean to Text String

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
hfreedman - 07 Mar 2006 19:50 GMT
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
John Nurick - 07 Mar 2006 20:21 GMT
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
[quoted text clipped - 6 lines]
>
>Howard

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
hfreedman - 07 Mar 2006 20:40 GMT
Hi John,

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

Howard Freedman

> Hi Howard,
>
[quoted text clipped - 30 lines]
>
> Please respond in the newgroup and not by email.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.