Vb Script For Conditional Value In Text Field Follow

0
Avatar
Legacy Poster

I am using Bartender Automation V 10.1 running on a Windows 7 Professional  Service Pack 1 computer.

I have a label with a field named ExpDate that is prompted for a value at the time of printing from an input box on the Data Entry Form.  This field is named ExpDateInputBox.  Without scripting the label field will print any valid date entered into the Data Entry Form (albiet in a specific format) and works well.

However, not all products have an expiration date. This expiration date (when there is one) is entered by the user.   In the case where there is no expiration date, I would like to instruct the user to enter "N/A" and a VB script would modify the value of ExpDate based on the input value of ExpDateInputBox in the data entry form.  I have looked at many examples here and have come up with what I think would work.

I have entered this script into the Transforms/VB Script section of the ExpDate object using the On ProcessData.

 

If Format.Objects("ExpDateInputBox").Value = "N/A" Then
    Format.Objects("ExpDate").Value = "N/A"
Else
    Format.Objects("ExpDate").Value = Format.Objects("ExpDateInputBox").Value
End if
 
When I try to save the script i get an error message #6900 stating "<Line 7: :Operation not supported for this object type.>"
 
I am sure that I am close but cannot figure out what is else is needed.  Any help is greatly appreciated.
 
Thanks,
 
Gary

1 comments

0
Avatar
Legacy Poster
Comment actions Permalink

Make your data type a Multi-Line VB script rather than putting it in transforms.

 

Get rid of " Format.Objects("ExpDate").Value = " and replace it with just "Value ="

Please sign in to leave a comment.