Question:
Can a command button write three or more different values in sequence every time it is pushed?
Solution:
Yes; to do so, you must use a command via scripts from Click event so that whenever the button is pushed, a new value can be loaded (considering this tag’s latest value).
In this case, there are decision commands that can help in this function, such as IF command alongside ELSEIF, for example:
If tag.value = 1 Then
tag.value = 2
Elseif tag.value = 2 Then
tag.value = 3
Elseif tag.value = 3 Then
tag.value = 4
Else
tag.value = 5
End if
The sample application below shows all the resources mentioned in this article.