Disappearing VB script 追蹤

0
Avatar
Josh Meijer

Good day, I have a client running Bartender 2019 R9 Automation version 11.1/156128 (64-bit)

I configured a label template with a table object and am populating the table using the following VB script on OnFillList event:

dim objConn
dim strConn
dim rs

strConn = "Provider=MSDASQL;DSN=Granite;"
Set objConn = CreateObject("ADODB.Connection")
objConn.Open strConn

Set rs = CreateObject("ADODB.Recordset")

Set rs = objConn.Execute("SELECT MasterItem.Description, SUM(ActionQty) as Qty "&_
"FROM Document INNER JOIN "&_
"[Transaction] ON Document.ID = [Transaction].Document_id INNER JOIN "&_
"MasterItem ON [Transaction].FromMasterItem_id = MasterItem.ID "&_
"WHERE [Transaction].[Type] = 'PICK' AND Document.Number =
'"&Format.NamedSubstrings("Document").Value&"' "&_
"GROUP BY MasterItem.Description")

Value = ""

Do Until rs.EOF
Value = Value & rs.fields(0) & VbTab & rs.fields(1) & vbCr
rs.MoveNext
Loop

The code works perfectly and prints as expected

The problem is that the VB code seems to disappear when I save and close the Bartender document. Every time I open the .btw file, I need to copy the code back in to the OnFillList event in order to print the necessary data.

I've tried creating the label over from scratch, but I can't seem to get the code to save with label file. Any help in this matter would be greatly appreciated!

 

1 意見

0
Avatar
Laura Vela
版主
評論操作 永久連結

Hello Josh,

Thank you for your message.

I think for this particular case (at least at this point) it might be easier to handle via a Support Ticket, I have created one based on the contents of this forum, so we will get back to you as soon as possible for further troubleshooting.

Greetings,

Laura

登入寫評論。