Any thing wrong with =[form]![Items]![LIST_PRICE] *2

Q

Qrystems

I was trying to populate a field from another field called "List_Price" using
=[form]![Items]![LIST_PRICE] *2 expression on deafult value properties. It
keep on giving me error whenever I tried to save. The error is "Colud not
find field 'form]![Items]![LIST_PRICE
Is anyone familiar with this problem? Thanks for your help
QRS
 
S

Steve Schapel

QRS,

Ofer's advice is correct, is that you have apparently omitted the "s"
form the end of "Forms". I am also wondering about your use of the
Default Value property... The Default Value applies at the point of
creation of a new record, so it can't refer to the value of another
field, since the other field has no value at the point of creation of a
new record.

--
Steve Schapel, Microsoft Access MVP

The right syntax will be
forms![FormName]![FieldName]

forms![Items]![LIST_PRICE]

:

I was trying to populate a field from another field called "List_Price" using
=[form]![Items]![LIST_PRICE] *2 expression on deafult value properties. It
keep on giving me error whenever I tried to save. The error is "Colud not
find field 'form]![Items]![LIST_PRICE
Is anyone familiar with this problem? Thanks for your help
QRS
 
Q

Qrystems

Thanks Buddy.
But how do I increase the value of a filed (LIST_PRICE in this case) and
use it to populate another field of thesame record?
--
QRS


Steve Schapel said:
QRS,

Ofer's advice is correct, is that you have apparently omitted the "s"
form the end of "Forms". I am also wondering about your use of the
Default Value property... The Default Value applies at the point of
creation of a new record, so it can't refer to the value of another
field, since the other field has no value at the point of creation of a
new record.

--
Steve Schapel, Microsoft Access MVP

The right syntax will be
forms![FormName]![FieldName]

forms![Items]![LIST_PRICE]

:

I was trying to populate a field from another field called "List_Price" using
=[form]![Items]![LIST_PRICE] *2 expression on deafult value properties. It
keep on giving me error whenever I tried to save. The error is "Colud not
find field 'form]![Items]![LIST_PRICE
Is anyone familiar with this problem? Thanks for your help
QRS
 
S

Steve Schapel

QRS,

Well, will the "another field" always be equal to LIST_PRICE*2 ? If so,
you are best not to have a field at all. You can just put an unbound
textbox on the form or report, and set its Control Source property to...
=[LIST_PRICE]*2
 
Q

Qrystems

Thanks Steve.
The fields type are currency so the have equal lenght. Can you sheld more
light on the your answer. I do not get that approache clearly.
All I want to do is to be able to increase tha value of field "A" and put it
in field "B" of thesame table.
--
QRS


Steve Schapel said:
QRS,

Well, will the "another field" always be equal to LIST_PRICE*2 ? If so,
you are best not to have a field at all. You can just put an unbound
textbox on the form or report, and set its Control Source property to...
=[LIST_PRICE]*2

--
Steve Schapel, Microsoft Access MVP

Thanks Buddy.
But how do I increase the value of a filed (LIST_PRICE in this case) and
use it to populate another field of thesame record?
 
J

John Vinson

Thanks Steve.
The fields type are currency so the have equal lenght. Can you sheld more
light on the your answer. I do not get that approache clearly.
All I want to do is to be able to increase tha value of field "A" and put it
in field "B" of thesame table.

No. You don't want to do this!

Storing derived data such as this in your table accomplishes
three things: it wastes disk space; it wastes time (almost
any calculation will be MUCH faster than a disk fetch); and
most importantly, it risks data corruption. If one of the
underlying fields is subsequently edited, you will have data
in your table WHICH IS WRONG, and no automatic way to detect
that fact.

Just redo the calculation whenever you need it, either as a
calculated field in a Query or just as you're now doing it -
in the control source of a Form or a Report textbox.


John W. Vinson[MVP]
 
Q

Qrystems

Thanks John. If I want to go through Query approach. How do i go about that
and what format should i use?
 
S

Steve Schapel

QRS,

Make a query based on the table that contains the LIST_PRICE field. Add
to the query grid whichever fields from this table you want in yoiur
form or report. Then, in the Field row or a blank column in the query
design grid, make a calculated field like this...
AnotherField: [LIST_PRICE]*2
Then, you can put a textbox on the form or report which is bound to this
calculated field. Any formatting can be applied to the textbox on the
form or report, you probably don't need to worry about this within the
query.
 
Q

Qrystems

Thanks it helps
--
QRS


Steve Schapel said:
QRS,

Make a query based on the table that contains the LIST_PRICE field. Add
to the query grid whichever fields from this table you want in yoiur
form or report. Then, in the Field row or a blank column in the query
design grid, make a calculated field like this...
AnotherField: [LIST_PRICE]*2
Then, you can put a textbox on the form or report which is bound to this
calculated field. Any formatting can be applied to the textbox on the
form or report, you probably don't need to worry about this within the
query.

--
Steve Schapel, Microsoft Access MVP

Thanks John. If I want to go through Query approach. How do i go about that
and what format should i use?
 
Top