Hiding 2 Objects Based On A Access Database Field Follow

0
Avatar
Legacy Poster

Heya, 

 

Currently using Bartender 9.01 and need some help with it's VBA, unfortunately i'm not really familiar with BT VBA

 

I'm trying to write a VBA script that instructs bartender to not print 2 fields based on another value of a field, which effectively grabs the data from an access database

 

anyhow, at this time i keep getting a Line 6 Type Mismatch: 'Object' error message

 

Any suggestions?

 

'Automatically called whenever the value of the Sub String is needed.
'Set the Value property to set the value of this sub string.

If Field("NoBestBefore") = "1" Then
	Value = ""
	Object("Text 17").PrintVisibility = False
Else 
If IsNumeric(BBOffset) Then 
  Value = DateAdd("d",BBOffset,DateAdd("d",0,PackedDate))
Else
Value = "Error"
	Object("Text 17").PrintVisibility = False
End if
End If

 

2 comments

0
Avatar
Shotaro Ito
Comment actions Permalink

Object Automation in VB Script is introduced from BarTender 9.30 Automation edition or above, so unfortunately at 9.01 ”PrintVisibility" property was not supported.

Besides, BarTender's text object will not be printed if data source is empty.

 

Give share name to the data source of Text 17 (ex. TX17), then have script like..

If Field("NoBestBefore") = "1" Then
    Value = ""
    TX17 = ""
Else
    TX17 = "Best Before:"
End if

This topic might helps.

http://forums.seagullscientific.com/index.php?/topic/2488-print-dont-print-based-on-database-value/?hl=printvisibility

 

From BarTender 10.1 Automation edition or above, conditional print is introduced - such as Print when <Database Field X> is Not empty etc,  so please try the latest version too.

http://www.seagullscientific.com/label-software/whitepapers/whitepaper_whatsnewinbt101.pdf

0
Avatar
Legacy Poster
Comment actions Permalink

cheers for your help.

 

after a few more Trial and Errors after posting, i've ended up doing something similar to such, though slightly bloated. 

Please sign in to leave a comment.