Assign and display a meaning to a numeric value?

I

Ian McLeish

I am using a VB program, which I didn't write. It saves info as an .mdb file.
One of the bits of info it saves (it is an opticians recall program) is for
the patient's prescription. When using a prism, it needs to be assigned a
base direction( UP, DOWN, LEFT, Right )etc. The program seems to store these
values as numbers- say 1 for up and 2 for down.

Would anyone know how I could convert these values back into UP down etc?

To explain a little clearer, each box in the database can hold one of two
values either 1 or 2 (up or down)- there is another cell in the database to
store left or right, (again as 1 or 2).

I thought this might be a conditional formatting trick, but had no success,
thanks ian
 
K

KARL DEWEY

They probably were using an Options group. You can on your form and use the
field to it and have your cake back.
 
F

fredg

I am using a VB program, which I didn't write. It saves info as an .mdb file.
One of the bits of info it saves (it is an opticians recall program) is for
the patient's prescription. When using a prism, it needs to be assigned a
base direction( UP, DOWN, LEFT, Right )etc. The program seems to store these
values as numbers- say 1 for up and 2 for down.

Would anyone know how I could convert these values back into UP down etc?

To explain a little clearer, each box in the database can hold one of two
values either 1 or 2 (up or down)- there is another cell in the database to
store left or right, (again as 1 or 2).

I thought this might be a conditional formatting trick, but had no success,
thanks ian

=IIF([FieldNameA] =1,"Up","Down")
=IIF([FieldNameB] =1,"Left","Right")
 
L

Larry G.

I would imagine the best way to fix this would be an updat query. First make
a backup copy of the database so you do not lose valuable data. Then convert
both fields to Text from numeric. Then design a query that will update all
values of "1" to "UP" and all values of "2" to "DOWN" Then do the same for
the left and right. Just make sure that the program you are using will accept
these values.
 
A

Albert D.Kallal

As a normal rule, you use your database skills to solve this. Why not just
build a table. with two columns

PrisID Description
1 up
2 down
3 left
4 right

The beauty of such a above approach is that you can over time ADD NEWW types
of angles, and NOT HAVE TO MODIFY the original code. You don't want to hard
code this stuff.

Then, you simply fire up your favorite query builder, and drop in the
original main table, and drop in the above lookup values and "join" based on
the prisim angle.

Virtually every application you write will "often" have thee types of
lookups and translations, and the solution is to use sql to do all the
having lifting for you....
 
I

Ian McLeish

Thanks Fred, just one more- I note that most fields have a zero value, so
what I told you before was incorrect- each field could have one of three
values 0,1 or 2. Would there be a way to get around that one. Sorry for
feeding you incorrect info, but many thanks for your work (and everyone else
who helped)

Ian

fredg said:
I am using a VB program, which I didn't write. It saves info as an .mdb file.
One of the bits of info it saves (it is an opticians recall program) is for
the patient's prescription. When using a prism, it needs to be assigned a
base direction( UP, DOWN, LEFT, Right )etc. The program seems to store these
values as numbers- say 1 for up and 2 for down.

Would anyone know how I could convert these values back into UP down etc?

To explain a little clearer, each box in the database can hold one of two
values either 1 or 2 (up or down)- there is another cell in the database to
store left or right, (again as 1 or 2).

I thought this might be a conditional formatting trick, but had no success,
thanks ian

=IIF([FieldNameA] =1,"Up","Down")
=IIF([FieldNameB] =1,"Left","Right")
 
F

fredg

Thanks Fred, just one more- I note that most fields have a zero value, so
what I told you before was incorrect- each field could have one of three
values 0,1 or 2. Would there be a way to get around that one. Sorry for
feeding you incorrect info, but many thanks for your work (and everyone else
who helped)

Ian

fredg said:
I am using a VB program, which I didn't write. It saves info as an .mdb file.
One of the bits of info it saves (it is an opticians recall program) is for
the patient's prescription. When using a prism, it needs to be assigned a
base direction( UP, DOWN, LEFT, Right )etc. The program seems to store these
values as numbers- say 1 for up and 2 for down.

Would anyone know how I could convert these values back into UP down etc?

To explain a little clearer, each box in the database can hold one of two
values either 1 or 2 (up or down)- there is another cell in the database to
store left or right, (again as 1 or 2).

I thought this might be a conditional formatting trick, but had no success,
thanks ian

=IIF([FieldNameA] =1,"Up","Down")
=IIF([FieldNameB] =1,"Left","Right")

=IIf([FieldA]=0,"Whatever",IIf([FieldA]=1,"Up","Down"))
 
I

Ian McLeish

Perfect Fred, thank you very much,

Ian

fredg said:
Thanks Fred, just one more- I note that most fields have a zero value, so
what I told you before was incorrect- each field could have one of three
values 0,1 or 2. Would there be a way to get around that one. Sorry for
feeding you incorrect info, but many thanks for your work (and everyone else
who helped)

Ian

fredg said:
On Thu, 29 Sep 2005 11:04:03 -0700, Ian McLeish wrote:

I am using a VB program, which I didn't write. It saves info as an .mdb file.
One of the bits of info it saves (it is an opticians recall program) is for
the patient's prescription. When using a prism, it needs to be assigned a
base direction( UP, DOWN, LEFT, Right )etc. The program seems to store these
values as numbers- say 1 for up and 2 for down.

Would anyone know how I could convert these values back into UP down etc?

To explain a little clearer, each box in the database can hold one of two
values either 1 or 2 (up or down)- there is another cell in the database to
store left or right, (again as 1 or 2).

I thought this might be a conditional formatting trick, but had no success,
thanks ian

=IIF([FieldNameA] =1,"Up","Down")
=IIF([FieldNameB] =1,"Left","Right")

=IIf([FieldA]=0,"Whatever",IIf([FieldA]=1,"Up","Down"))
 
Top