Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Yes/No Field loses format 1

Status
Not open for further replies.

TimTDP

Technical User
Feb 15, 2004
373
ZA
In an Access 2000 database I have a table contianing fields, formatted as Yes/No

In a query I have the following expression:-
THCDisbursment: IIf([IsContainer]=True,[Disbursment],[NonDisbursment])

When I run the query the results are shown as "-1" or "0"
How do I the results to be shown as a check box?

I have tried:-
THCDisbursment: Format(IIf([IsContainer]=True,[Disbursment],[NonDisbursment]),"True/False")

This does show the results as True or False, but I want a check box!
 
I'm not 100 percent sure, but I don't think you can do that.

I think this relates to the Display Control property, which you (for some reason) can find as field properties also in queries (lookup tab), which I think is available for non calculated fields, but probably not for calculated fields.

I think, to achieve this, one of the ways, would be to dump the data into a temptable where this format is predefined for the field (which will increase the bloat ;-) )

To voice my opinion - you shouldn't let the user view a query, but let them see the information through a form or report, where you can bind this calculated field to a checkbox. Do the formatting in the report or form, and consentrate on dataretrieval, aggregations, joins ... in the query ...

In stead of using the format function as a calculation, you could have used the format property of the field, both "Yes/No" and "True/False" in that property, gives you formats that utterly fails to meet your requirements ;-)

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top