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 / SQL Server / ADP / January 2006

Tip: Looking for answers? Try searching our database.

How to display a Checkbox for a field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ryan Langton - 27 Jan 2006 19:55 GMT
I have a view I'm creating that is somewhat of a summary view.  The Bit
field it has no problem displaying as a checkbox, that's the way I have it
defined in the Table.  However, what about displaying Checkboxes for other
fields?  For example, I have a field called LastAction.  If the LastAction
field is Not Null I want the checkbox to be checked, if it IS Null, I want
the checkbox unchecked.  Here's the portion of my T-SQL statement that
pertains to this "LastAction" field:

CASE WHEN LastAction IS NULL
                     THEN 0 ELSE 1 END AS Actions

Now this displays 0 or 1 depending on whether the Actions field contains
data.  Is there anyway to make it display a checkbox instead (Checked for 1,
Unchecked for 0)

Thanks,
Ryan
Tom Ellison - 29 Jan 2006 00:36 GMT
Dear Ryan:

How about:

CBool(LastAction IS NOT NULL)

A column must be explicitly boolean to display with a check box.

Tom Ellison

>I have a view I'm creating that is somewhat of a summary view.  The Bit
>field it has no problem displaying as a checkbox, that's the way I have it
[quoted text clipped - 13 lines]
> Thanks,
> Ryan
Ryan Langton - 30 Jan 2006 16:44 GMT
What about this tells it to display as a check box though?  Won't it still
display as a 1 or 0?

> Dear Ryan:
>
[quoted text clipped - 23 lines]
>> Thanks,
>> Ryan
Sylvain Lafontaine - 29 Jan 2006 03:12 GMT
You can try to convert the result to a Bit field using the Convert() or the
Cast() functions on the result of the Case statement.

Signature

Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF

>I have a view I'm creating that is somewhat of a summary view.  The Bit
>field it has no problem displaying as a checkbox, that's the way I have it
[quoted text clipped - 13 lines]
> Thanks,
> Ryan
Ryan Langton - 30 Jan 2006 16:47 GMT
I tried CAST( <CASE STATEMENT> AS BIT) AS Actions
Now it displays as either True or False.  Is there any way to tell it to use
a checkbox?

Thanks,
Ryan

> You can try to convert the result to a Bit field using the Convert() or
> the Cast() functions on the result of the Case statement.
[quoted text clipped - 16 lines]
>> Thanks,
>> Ryan
 
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.