change text value according to number of scans S’abonner

0
Avatar
Reza

Hi. I've a QTY text on label template. It should get a few number of barcodes through barcode scanner with inputbox message and then change QTY text value according to number of scanned barcodes. My problem is the number of barcodes not stored in database and the text value property only change according to database.

5 commentaires

0
Avatar
Shotaro Ito
Actions pour les commentaires Permalien

Hi Reza,

If you have some barcodes on a label and have multiple text input box on a form,

then you can add number of entered (scanned) text box.

Name each data source of barcodes (ex. BC1, BC2, BC3)

Create a  text with VB Script data source (multi line script)

 

 

n = 0
If LEN(BC1)>0 Then n = n + 1
If LEN(BC2)>0 Then n = n + 1
If LEN(BC3)>0 Then n = n + 1
Value = n
0
Avatar
Reza
Actions pour les commentaires Permalien

Hi Shotaro, Thank you for your comments. yes I have some text input box on a form that for example the operator can set packaging operator code and it should printed on the label, also the operator should scan barcode of products that should placed in the carton and the QTY text field in the label of carton shows quantity of scanned barcodes for reference of number of products placed in the carton. the main problem is the Text field and Textbox control values are read only property and the Textbox control value could be changed only in run time mode.

I open a excel file for database in the Vb Script code of "OnNEWRecord" and save every barcode in excel file but can't change QTY text according to contents of excel file or another variable because the property (format.objects("text...").Value is read-only.

may I want you explain more your comment and also about multi line script

Thanks.

1
Avatar
Shotaro Ito
Actions pour les commentaires Permalien

To able to change text value from VB Script, you need to name data source of the text. Try below..

1. Create 2 text. (Text 1,  Text 2)

2. In Text 1's  property, select data source (Embedded data).

3. Name data source as VAR1 from the button at right of Name: box in Data Source tab

 

4. On Text 2, change data source type to VB Script. You can read and set value of other data source,
such as VAR1 = "Hello" etc.

 

0
Avatar
Reza
Actions pour les commentaires Permalien

Hi Shotaro,

this was a good and new Idea that I learned from you but can I change text field value in my OnNewRecord script, for example in For...Next loop QTY.Value = I   (I is the For...Next loop counter)

one another question, can I save operator inputs in data entry form to the database instead of reading data from database ?

Thanks.

0
Avatar
Shotaro Ito
Actions pour les commentaires Permalien

You can apply VB Script in OnNewRecord too.

BarTender's database connection is read only so you cannot write back value to Excel database. also when you connect to an Excel file from BarTender document's database setup, you cannot access to the same Excel file on the  document's VB Script, as BarTender locks the excel file during print Job.

For complex data processing such as update database and calculate values, I recommend to create such form on custom application by C# / VB.net or Access etc.
From that application, you can export text file (CSV) to print.
Then BarTender Integration can detect the CSV file and automatically print btw file with the CSV data.
(Automation edition or above required)

Integration
https://support.seagullscientific.com/hc/en-us/categories/204151647-Integration 

 

Vous devez vous connecter pour laisser un commentaire.