Change Position And Font Size If A Data Field Is Empty Follow

0
Avatar
Legacy Poster

Can we do like this

If "Field: 1.Item 2nd" Empty

Then Position "Field: 1.Item 1st"

X 2.33 Y 1.20

font size 12 pt

7 comments

0
Avatar
Ian Cummings
Moderator
Comment actions Permalink

Yes this is possible with recent versions of BarTender.  I suggest you take a look at the below white paper:

 

http://www.bartenderbarcodesoftware.com/label-software/whitepapers/dynamically-changing-objects-at-print-time-using-vb-script.pdf

 

And check the BarTender Help system under the "Visual Basic Scripting>Scripting Objects>Object Reference>Object Object" topic for a full reference on what's available.

0
Avatar
Legacy Poster
Comment actions Permalink

Thanks but unfortunately I cant figure this out attached is me btw file and my data file from the c:/ folder what I am looking that if line 2 is empty then line 1 Position Y = 0.8 font size = 14pt.

So when the 3rd line from the database is getting printed it should move "Field: db.line 1" to Position Y 0.8 and change font size to 14pt

Can you please do it on the attached file and upload it for me 

Thank you

0
Avatar
Legacy Poster
Comment actions Permalink

Thanks but unfortunately I cant figure this out attached is me btw file and my data file from the c:/ folder what I am looking that if line 2 is empty then line 1 Position Y = 0.8 font size = 14pt.

So when the 3rd line from the database is getting printed it should move "Field: db.line 1" to Position Y 0.8 and change font size to 14pt

Can you please do it on the attached file and upload it for me 

Thank you

 

Any help?

0
Avatar
Ian Cummings
Moderator
Comment actions Permalink

From the "File>BarTender Document Options" menu item select the "VB Scripting" tab and create a VB script for the "OnNewRecord" event.  You would then enter in something like the below:

 

If Format.Objects("Text 2").Name = "" Then
	Format.Objects("Text 1").Y = 0.8
	Format.Objects("Text 1").FontSize = 14
Else
	Format.Objects("Text 1").Y = 17.5
	Format.Objects("Text 1").FontSize = 12
End If
0
Avatar
Legacy Poster
Comment actions Permalink

It moves it to Y 17.5 even if  Objects("Text 2") is empty

0
Avatar
Legacy Poster
Comment actions Permalink

It moves it to Y 17.5 even if  Objects("Text 2") is empty

Please help

Thanks

0
Avatar
Ian Cummings
Moderator
Comment actions Permalink

Ooops, looks like I made a typo.  See the correct code below:

 

If Format.Objects("Text 2").Value = "" Then
	Format.Objects("Text 1").Y = 0.8
	Format.Objects("Text 1").FontSize = 14
Else
	Format.Objects("Text 1").Y = 17.5
	Format.Objects("Text 1").FontSize = 12
End If

Please sign in to leave a comment.