Skip to main content

Search

Search

Changing Values Of Printed Fields Based Upon Dropdown Choice

Comments

1 comment

  • Avatar
    Fernando Ramos Miracle
    [quote name='Eric T.' timestamp='1354208948' post='3824']
    I have been tasked with creating a label that includes, among other things, a ship-to address. Rather than making the user key in the address each time, I want to allow them to pick the frequently-used addresses from a dropdown list. I want them to make a single choice, but then all lines of the given address will print on the label. I know scripting is the answer for this, but I'm not sure how to do it. Does anyone have an example of something like that that they're willing to share? Thanks!
    [/quote]


    Basically what you wish to do is query a data base through a dropdown menu in the Query Prompt. Unfortunately this is not directly supported by BarTender at the moment so you will need to do it through a VB Script.

    We've created a sample label format with a couple VB Scripts that do two things (attached):

    1. Fills a drop down list from an Excel spreadsheet.
    2. Uses the choice selected in the drop down list to query the database again to retrieve records that match the selection.

    The database used should be an Excel file with the following structure (this type of files are not allowed to be submitted so you'll need to recreate it):

    Fruit Price
    Apple 1
    Banana 1.25
    Pear 1.5
    Mango 1.75
    Peach 2

    The sheet should be called [i]TABLE_NAME[/i] and the Excel file should be called Fruit.xls (of course you can adapt all these settings at your convenience).
    0

Please sign in to leave a comment.