[AccessD] db execute on linked vs local table

Stuart McLachlan stuart at lexacorp.com.pg
Tue Feb 1 18:57:42 CST 2022


ENUM is a way to define constants with sequential values - used in a lot of languages - 
including VBA.  Look up Enum in VBE's Help.

That particular example has a stack of problems, including defining TRUE as 0 and FALSE 
as 1!

As for your query return. MS have a lot to answer for in the confusion they have created 
with Booleans, field names and default formats.

The stupdily named  "Yes/No" field is actually a  Boolean datatype which is a 16 bit signed 
integer field that only contains either 16 x 0 bits(0 as an Int) or 16 x 1 bits ( -1, as an Int)

Your IIF() functions will return either a boolean 0 or -1
(True and False are just named constants of type Boolean) contains one of the two boolean  
values above. 

> SELECT IIF(TF1,IIF(TF2,True,False),False) as TF_Result1,
> IIF(TF2,IIF(TF1,True,False),False) as TF_Result2 FROM aaTF
> 
> 
> What should a textbox bound to TF1_Result1 show on a record When TF1 =
> Yes and TF2 = -1


If both TF1 and TF2 aer "true" i.e. contain the Boolean value -1, then TF_Result1 will be a 
Booelan -1. 

Unless some other formatting is specified, the textbox should display the value of the 
constant "TRUE", i.e. "-1".



On 1 Feb 2022 at 19:08, Bill Benson wrote:

> I didn´t understand a word of it - and that says way more about me
> than the article I am sure. I also don´t know C or C++.
> 
> Did anyone look at my question anour returning True or False in the
> format of one of the fields in the interior of the IIF ?
> 
> And if returning a Yes/No instead of True, False is proper because TF1
> was of type Yes/No, then what should happen here?
> 
> SELECT IIF(TF1,IIF(TF2,True,False),False) as TF_Result1,
> IIF(TF2,IIF(TF1,True,False),False) as TF_Result2 FROM aaTF
> 
> 
> What should a textbox bound to TF1_Result1 show on a record When TF1 =
> Yes and TF2 = -1
> 
> ??



More information about the AccessD mailing list