Dynamically Change Color On Text Object
I was hoping for some VB assistance in Bartender Automation 9.4 SR3.
I am creating labels using a SQL database connection and want one text field to have a background color that is dependent upon another database field (that is not placed in the label but part of the same table). The BarTender text object is called "ItemText". I would like the background fill color to change based on criteria from a field in the same table. That field is not currently a part of the label and it is called "Prod_cat" in the SQL database. When this field is equal to a "B1", I would like the background color of "ItemText" to be red. When this field is equal to a "B2", I would like the background color of "ItemText" to be aqua. I am having trouble returning anything from the Label Format Options OnNewRecord event. Can someone please help me with the syntax and where I need to put these items? Anything I have tried has resulted in a 12345678 error or worse.
Thank you for your assistance.
I am creating labels using a SQL database connection and want one text field to have a background color that is dependent upon another database field (that is not placed in the label but part of the same table). The BarTender text object is called "ItemText". I would like the background fill color to change based on criteria from a field in the same table. That field is not currently a part of the label and it is called "Prod_cat" in the SQL database. When this field is equal to a "B1", I would like the background color of "ItemText" to be red. When this field is equal to a "B2", I would like the background color of "ItemText" to be aqua. I am having trouble returning anything from the Label Format Options OnNewRecord event. Can someone please help me with the syntax and where I need to put these items? Anything I have tried has resulted in a 12345678 error or worse.
Thank you for your assistance.
0
-
Bump. Anyone? 0 -
Permanently deleted user
★ BarTender Hero ★
BarTender may not read database fields if it thinks that no object is using that field. Try creating a text object that references the database field, and then drag that text object off of the label so it doesn't print. Then, go to your Document Options / VB Scripting / OnNewRecord event and try setting FillColor of the object based on the value of that text object. Let us know if that helps.
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
2 Kommentare