Skip to main content

Search

Search

Serialize with vbscript?

Comments

1 comment

  • Avatar
    Peter Thane

    You could make it two fields.

    The first field (can be placed off the side of the label so it does not print)

    • reads the data from the database but is set to numeric only and so the hyphen is removed. 
    • set to decrement whilst preserving the number of characters with a reset to 10-000 set
    • set to have a minimum of 5 characters padding a 0 to the left with the warning disabled.
    • Given a "name" on the Data Source tab

    The second field

    • VB script field with the base Value coming from the "name" used for 1st field
    • Use left and right commands to split the field into two parts 
    • Concatenate the 2 parts together  with a "-" in between

    i.e something like the below where "hello" is the name I gave to field...

    Value = Format.NamedSubStrings("hello").Value

    Value1=left(Value,2)
    Value2=Right(Value,3)
    Value = Value1 & "-" & Value2

    (I had tried playing briefly with the Character Filter option but it didn't want to play ball but the above seems to work okay.)

    0

Please sign in to leave a comment.