revert back to last value

D

DavisGail

I am working in Access 2003. I have a medical form that has 20 fields. Each
field is assigned a code number. If any of those fields is marked as
abnormal, I would like my field [NotQualCode] to use the code of the FIRST
abnormal code.
Any ideas?
 
M

Mr. B

While I feel sure that what you want to do is very possible, please consider
that there could be some issues to deal with. For example, just using some
code in the After Update event of each of the 20 fields to call a
user-defined function that would evaluate the current value of your
[NotQualCode] field and if that field is null then just write the value of
the current control as the value of the [NotQualCode] field would be pretty
straight forward. However, you will have to take into consideration that at
any given time the user may decide to change the values for any of the 20
controls. Now, which control will be the "first" control with the "abnormal"
value?

If the 20 controls are places one the form and named using a numbering
sequence then it would be possible to itereate through all of the 20 controls
and take the first one you fine an "abnormal" value in as the one to use in
the [NotQualCode] field.

If you can provide a little more info about just how this should work,
perhaps some of the folk around here will be able to assist.


-----
HTH
Mr. B
http://www.askdoctoraccess.com/
Doctor Access Downloads Page:
http://www.askdoctoraccess.com/DownloadPage.htm
 
J

Jeff Boyce

Access stores data in tables in whatever order it wishes. The concepts of
FIRST and LAST don't mean the same thing to Access as they might to you.

How do YOU wish these to be defined?

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or psuedocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
D

DavisGail

I am trying to make data entry a little easier for the staff. If the first
field is Abnormal, I want the NotQualCode to be 40. I the second field is
abnormal, I want the code to still be 40, as it was the first disqualifying
field. The code will be enabled so that it can be changed if the
'calculated' code is incorrect. Most of the time, in my situation, it will
be the first code.

Mr. B said:
While I feel sure that what you want to do is very possible, please consider
that there could be some issues to deal with. For example, just using some
code in the After Update event of each of the 20 fields to call a
user-defined function that would evaluate the current value of your
[NotQualCode] field and if that field is null then just write the value of
the current control as the value of the [NotQualCode] field would be pretty
straight forward. However, you will have to take into consideration that at
any given time the user may decide to change the values for any of the 20
controls. Now, which control will be the "first" control with the "abnormal"
value?

If the 20 controls are places one the form and named using a numbering
sequence then it would be possible to itereate through all of the 20 controls
and take the first one you fine an "abnormal" value in as the one to use in
the [NotQualCode] field.

If you can provide a little more info about just how this should work,
perhaps some of the folk around here will be able to assist.


-----
HTH
Mr. B
http://www.askdoctoraccess.com/
Doctor Access Downloads Page:
http://www.askdoctoraccess.com/DownloadPage.htm


DavisGail said:
I am working in Access 2003. I have a medical form that has 20 fields. Each
field is assigned a code number. If any of those fields is marked as
abnormal, I would like my field [NotQualCode] to use the code of the FIRST
abnormal code.
Any ideas?
 
D

DavisGail

Jeff,
If field1 is "abnormal", I want the code to be 40. if field2 is abnormal, I
still want the code to be abnormal as it was before field2.

Jeff Boyce said:
Access stores data in tables in whatever order it wishes. The concepts of
FIRST and LAST don't mean the same thing to Access as they might to you.

How do YOU wish these to be defined?

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or psuedocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.


DavisGail said:
I am working in Access 2003. I have a medical form that has 20 fields.
Each
field is assigned a code number. If any of those fields is marked as
abnormal, I would like my field [NotQualCode] to use the code of the FIRST
abnormal code.
Any ideas?
 
J

Jeff Boyce

We aren't there. We can't see what you're looking at. We can't see your
data. Where did the "code = 40" come from?

If you are saying that knowing one field's value determines another field's
value, why are you bothering to use two fields to define the same fact?

(much) more info, please...!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or psuedocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

DavisGail said:
Jeff,
If field1 is "abnormal", I want the code to be 40. if field2 is abnormal,
I
still want the code to be abnormal as it was before field2.

Jeff Boyce said:
Access stores data in tables in whatever order it wishes. The concepts
of
FIRST and LAST don't mean the same thing to Access as they might to you.

How do YOU wish these to be defined?

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or psuedocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.


DavisGail said:
I am working in Access 2003. I have a medical form that has 20 fields.
Each
field is assigned a code number. If any of those fields is marked as
abnormal, I would like my field [NotQualCode] to use the code of the
FIRST
abnormal code.
Any ideas?
 

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