Skip to main content

Search

Search

If else statement in VB script

Comments

3 comments

  • Avatar
    K T

    Enter the following code in onprocessdata:

    if left(value,3)="191" then value="NO" else value="YES"

    1
  • Avatar
    Peter Thane

    Similar to the above, but as some of the data is coming from a database I would suggest you make the label field itself a Visual Basic field set as an Event Controlled Script. You should then select the OnNewRecord option so the VB is applied only when a new database record field is selected.

     

    Once linked to a database you can reference the database fields directly from the column on the right by double clicking on them (ie for the example below I typed in Value = and then double clicked on the Code field to add the rest).

    You can set the Then and Else parameters as required either typing them into "  " or else double clicking on a different database field if that is what you need.

    I hope this helps

     

    1
  • Avatar
    ameer ameer

    Thank you to both KT and Peter. Due to not enough time, I set it as user input upon print (form). I will try above logic.

     

    0

Please sign in to leave a comment.