Skip to main content

Search

Search

Script To Skip The Record If And Print The Next One

Comments

1 comment

  • Avatar
    Fernando Ramos Miracle
    Hello rits,

    1. One option to avoid printing duplicated or repeated records would be to access the "File>Database Connection setup..." option and, under the "Options" tab, uncheck the "Allow Duplicates" option.

    This will remove all records with repeated information over the [i]USED[/i] fields. If you only wish to apply this [i]selection[/i] over one of your fields (not considering the rest) you'll need to design a custom SQL statement under the "SQL" tab from the same dialog.

    2. The previous option wouldn't really fulfil your needs and would make nearly impossible to achieve your second request. A better option available only if working with v10 would be using a Template selector combined with a VB Script.

    Using the VB Script you'll need to save for each record the "Carton Number" and, also for each record, compare it with the previous one. If they are the same, the template for this new repeated record won't print (the value for the template selector is changed so it doesn't identify the correct template).

    As this will allow the application to run through all the records you should also be able to use a VB Script to count the repeated ones and print the result, being that the case, you'll need to consider printing that precise template only for the last repeated record (you'll need to think on the VB SCript for that, also comparing the present value for "Carton Number" with the next record's one, for that you'll need to create a second connection to the database through the VB Script).

    3. Thinking about this issue in general (especially your second request), I think it would be way more simpler to design an external application that does what you require and automates BarTender to print the required documents with the require data.
    0

Please sign in to leave a comment.