Setting calculated field equal to calculated value

G

Guest

I don't know how to express this properly I'm afraid... therefore I'm having
a tough time searching for the answer.

[txtAmendReq] Control Source is:

=IIf(Abs([txtDifference])>5,"Yes","No")

After I enter the values necessary to calculate the [txtDifference] field,
[txtAmendReq] is displaying "Yes" or "No" properly, however, looking through
the table, I note that [txtAmendReq] is not being updated with "Yes" or "No",
it's empty. I want to store either "Yes" or "Not", or 1 or 0, in the table.
How can I do this?

TIA
 
J

Jeff Boyce

Ricter

Where are you trying to do this? If you are working in a query, you can use
expressions like this.

If you are working in a table, you cannot do this -- Access doesn't have
triggers for its tables.

If you are working in a form, and trying to set the value of a text control
on the form, what event has to happen for this setting to be fired?

More info, please...

Jeff Boyce
Microsoft Office/Access MVP
 
S

Steve Schapel

Ricter,

Well, there are ways to write values from unbound form controls into a
table, using macro or VBA procedure. But, can you say why you want to
store the "Yes" or "No" in the table? This would normally be regarded
as an invalid database design choice. You probably should not even have
the txtAmendReq field in the table at all, and I would suggest you solve
the probelm by deleting the field. It is a calculated or derived value,
and as such you can calculate or derive it whenever you need it.
 
G

Guest

Thank you all, 'preciate it. Steve, you're right, I forgot about that db
design norm with this calculated field. I can indeed produce the query I
need for all those records where the abs > 5, without ever storing it.



Steve Schapel said:
Ricter,

Well, there are ways to write values from unbound form controls into a
table, using macro or VBA procedure. But, can you say why you want to
store the "Yes" or "No" in the table? This would normally be regarded
as an invalid database design choice. You probably should not even have
the txtAmendReq field in the table at all, and I would suggest you solve
the probelm by deleting the field. It is a calculated or derived value,
and as such you can calculate or derive it whenever you need it.

--
Steve Schapel, Microsoft Access MVP
I don't know how to express this properly I'm afraid... therefore I'm having
a tough time searching for the answer.

[txtAmendReq] Control Source is:

=IIf(Abs([txtDifference])>5,"Yes","No")

After I enter the values necessary to calculate the [txtDifference] field,
[txtAmendReq] is displaying "Yes" or "No" properly, however, looking through
the table, I note that [txtAmendReq] is not being updated with "Yes" or "No",
it's empty. I want to store either "Yes" or "Not", or 1 or 0, in the table.
How can I do this?

TIA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top