Read Field Script-Created Values With Document.onnewrecord
I have a number of fields that use multi-line vbScript to set their values. I need to show/hide their respective caption fields, based on the values in the data fields.
I tried creating the following document.OnNewRecord code to hide the captions when the field is blank, but it does not work:
If Format.Objects("ItemID").Value = "" Then
Format.Objects("ItemCaption").PrintVisibility = False
End If
The problem (I suspect) is that the vbScript in OnNewRecord runs before the script in the data field, which means it always sees a blank value, thus, the captions are always hidden.
Any suggestions?
Thanks
I tried creating the following document.OnNewRecord code to hide the captions when the field is blank, but it does not work:
If Format.Objects("ItemID").Value = "" Then
Format.Objects("ItemCaption").PrintVisibility = False
End If
The problem (I suspect) is that the vbScript in OnNewRecord runs before the script in the data field, which means it always sees a blank value, thus, the captions are always hidden.
Any suggestions?
Thanks
0
-
Shotaro Ito
★ BarTender Hero ★
Try the other way -
On Text "ItemCaption"s Datasource, Transform > VB Script (OnProcessData Event)
[code]If Format.Objects("ItemID").Value = "" Then Value = ""[/code]
(Ignore warning of not using "Value" in datasource upon close.)0 -
Legacy Poster
★ BarTender Hero ★
This worked perfectly. Thanks for your assistance. 0
Vous devez vous connecter pour laisser un commentaire.
Commentaires
2 commentaires