Mikaa
Posts: 9
|
| Posted: 03/13/2006, 3:12 AM |
|
Hi there,
<div id="VALUE">
Is it possible to have above "VALUE" changed based on a field in the DB?
Should i use a label?
Thanks for the reply.
regards,
Mikaa
|
 |
 |
mhope
Posts: 37
|
| Posted: 03/13/2006, 5:43 PM |
|
Yes, use a label as follows:
If grid.field.value = “Your database value” Then
Label1.value = “Your value”
Else
Label1.Value = “Other value”
End If
Also if the value in the Lable1 is HTML make sure to set that parameter in the design properties. Further if your label is in the grid then the label should be grid.Label1.Value = "Your value" on line 2
|
 |
 |
mhope
Posts: 37
|
| Posted: 03/13/2006, 5:46 PM |
|
Also, place the code in a before show event too
|
 |
 |
Mikaa
Posts: 9
|
| Posted: 03/13/2006, 11:46 PM |
|
Thanks mhope. That part is clear now!
Since this code is not in a form, i must use "Lookup", but the "VALUE" is changed every time a <option> changes.
for example:
<OPTION VALUE="1">A</OPTION>
<OPTION VALUE="2">B</OPTION>
<OPTION VALUE="3">C</OPTION>
And these options are different every time and can be more then 3. This is based on the date.
So it should be
If value = “Your database value from option” Then
Label1.value = “Your value”
Else
Label1.Value = “Other value”
End If
How can I solve this?
|
 |
 |
mhope
Posts: 37
|
| Posted: 03/13/2006, 11:56 PM |
|
Then use a case select like:
select case Label1.value
case 1
lable1.Value = "The value 1"
case 2
lable1.Value = "The value1"
ect.....
end select
|
 |
 |
|