$value()
is an important keyword that you should consider while designing conditional value assistance. Let us take a simple example to understand its usage and benefits.
Consider an attribute cust_name
, which represents a dropdown of the names of some office employees, for example Tom, Harry, and Chris as shown in figure 11.35.
cust_name |
---|
Tom |
Harry |
Chris |
Another attribute cust_age
needs to represent a dropdown of ages for each office staff member. Depending on the chosen name in cust_name
, the value in cust_age
needs to be populated.
Say for example, the table representing the names and corresponding ages of the office staff is as shown in figure 11.36:
Name |
Age |
---|---|
Tom |
23 |
Harry |
45 |
Chris |
19 |
A conditional value assistance could be established as follows:
If cust_name = "Tom" Then cust_age = 23 Else If cust_name = "Harry" Then cust_age = 45 Else If cust_name = "Chris" Then cust_age = 19 Else ...
What if the office staff member strength is close to 100 people? Would...