|
Home > Archive > MS Access data conversion > June 2005 > Making fields conditionally dependant on the values of other fields?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Making fields conditionally dependant on the values of other fields?
|
|
| Grady W Smithey III 2005-05-31, 8:27 pm |
| I am working on an order-entry form for my users, and need to make the value
of some fields conditionally dependant on the values of others. For
example, if FieldA = "NONE" then I need FieldB to have one value. If FieldA
= "YES" and FieldC = "OUT" then I need FieldB to have a different value, and
so on.
What is the best method for achieving this in Access 2000?
| |
| Douglas J. Steele 2005-05-31, 8:27 pm |
| It can't be done through tables. You could probably accomplish it on a form,
using VBA, or else as computed fields in a query. Note that if you have
rules defined as that, then you should NOT be storing the value of FieldB in
the table.
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Grady W Smithey III" <office@islagiatt.org? subject=Regarding%20
Your%20Post>
wrote in message news:u0$dwhhZFHA.796@TK2MSFTNGP10.phx.gbl...
>I am working on an order-entry form for my users, and need to make the
>value
> of some fields conditionally dependant on the values of others. For
> example, if FieldA = "NONE" then I need FieldB to have one value. If
> FieldA
> = "YES" and FieldC = "OUT" then I need FieldB to have a different value,
> and
> so on.
>
> What is the best method for achieving this in Access 2000?
>
>
| |
| Grady W Smithey III 2005-06-02, 11:24 am |
| Thanks for the tip, Doug. I'll start work on determining what the best
method will be fo rus.
"Douglas J. Steele" < NOSPAM_djsteele@NOSP
AM_canada.com> wrote in message
news:uQb8NmiZFHA.2496@TK2MSFTNGP14.phx.gbl...
> It can't be done through tables. You could probably accomplish it on a
form,
> using VBA, or else as computed fields in a query. Note that if you have
> rules defined as that, then you should NOT be storing the value of FieldB
in
> the table.
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no e-mails, please!)
>
>
>
> "Grady W Smithey III"
<office@islagiatt.org? subject=Regarding%20
Your%20Post>
> wrote in message news:u0$dwhhZFHA.796@TK2MSFTNGP10.phx.gbl...
>
>
| |
| Chris Mills 2005-06-04, 7:23 am |
| Like Doug, I think that writing code ("VBA") is the way to enforce your own
rules when Access does not cover it. That seems to apply to your case.
Of course, this does not prevent people violating your "rules", such as
manipulating the tables directly. But as a developer, you can't be too
concerned if they want to violate your system (your forms and underlying
code), apart from using security to disable the "database view".
Whenever you create your own rules (in code) which the database itself may not
enforce (such as, through Relationships), you should probably write some check
on the database, to be run once a month or whatever, to test for violations of
your "rule". This makes it easy to check if someone is "violating you".
Chris
"Grady W Smithey III" <office@islagiatt.org? subject=Regarding%20
Your%20Post>
wrote in message news:Ou8vwx4ZFHA.3712@TK2MSFTNGP09.phx.gbl...
> Thanks for the tip, Doug. I'll start work on determining what the best
> method will be fo rus.
>
> "Douglas J. Steele" < NOSPAM_djsteele@NOSP
AM_canada.com> wrote in message
> news:uQb8NmiZFHA.2496@TK2MSFTNGP14.phx.gbl...
> form,
> in
> <office@islagiatt.org? subject=Regarding%20
Your%20Post>
>
>
| |
| Grady W Smithey III 2005-06-16, 11:25 am |
| I'm not worried about people trying to violate the rules - I'm trying to set
up an order-tracking database, and want it to calculate the costs (which can
be a raging pain when you have as many variables in each component's cost as
my folks do.)
Time to go get more up to speed on VBA then, obviously. :)
"Chris Mills" < phad_nospam@cleardot
net.nz> wrote in message
news:#LL3$XPaFHA.1152@tk2msftngp13.phx.gbl...
> Like Doug, I think that writing code ("VBA") is the way to enforce your
own
> rules when Access does not cover it. That seems to apply to your case.
>
> Of course, this does not prevent people violating your "rules", such as
> manipulating the tables directly. But as a developer, you can't be too
> concerned if they want to violate your system (your forms and underlying
> code), apart from using security to disable the "database view".
>
> Whenever you create your own rules (in code) which the database itself may
not
> enforce (such as, through Relationships), you should probably write some
check
> on the database, to be run once a month or whatever, to test for
violations of
> your "rule". This makes it easy to check if someone is "violating you".
>
> Chris
>
> "Grady W Smithey III"
<office@islagiatt.org? subject=Regarding%20
Your%20Post>
> wrote in message news:Ou8vwx4ZFHA.3712@TK2MSFTNGP09.phx.gbl...
have[color=darkred]
FieldB[color=darkred
]
the[color=darkred]
value,[color=darkred
]
>
>
|
|
|
|
|