how do change the value of a field from -1 to yes

S

smason

i have a linked table which has a yes/no field which when in a query shows as
-1/0 how can i change these to yes/no
 
P

Pieter Wijnen

-1 = Yes = True in VBA

You can set the format property of the Table's Field, the Query's Field, The
Form/Reports's Control format property


Remember:

Tables are for storing data
Queries (select) are for retrieving data
Forms are for viewing / manipulating data
Reports are for reporting data

Pieter
 
F

fredg

i have a linked table which has a yes/no field which when in a query shows as
-1/0 how can i change these to yes/no

The value of a yes/no field is either -1 or 0.
That's what should be stored in your table.
No user need ever actually 'see' the table.

To display "Yes" or "No" in a query, you could use:
NewField:IIf([FieldName]=-1,"Yes","No")

You can then use [NewField] in your report or table.

Also, you can display, on a form or in a report, the text "yes" or
"no" instead of -1 or 0 by using an unbound text control.
Set it's control source to the [Yes/No] field.
Then as it's Format property, write:
;"Yes";"No";

See Access help on the Format Property + Currency and Number datatype
to learn why this works.
 
B

Bob Quintal

i have a linked table which has a yes/no field which when in a
query shows as -1/0 how can i change these to yes/no

The value of a yes/no field is either -1 or 0.
That's what should be stored in your table.
No user need ever actually 'see' the table.

To display "Yes" or "No" in a query, you could use:
NewField:IIf([FieldName]=-1,"Yes","No")

One should also be able to right-click on the column in query design
view, select properties and put Yes/No in the format box.

You can then use [NewField] in your report or table.

Also, you can display, on a form or in a report, the text "yes" or
"no" instead of -1 or 0 by using an unbound text control.
Set it's control source to the [Yes/No] field.
Then as it's Format property, write:
;"Yes";"No";

See Access help on the Format Property + Currency and Number
datatype to learn why this works.
 
Top