Looking for help about adding VB msgbox in a template S’abonner

0
Avatar
Danny chuang

Hi

I want to make a warning message showing to people by msgbox,if the value is ture. I want it display to someone who

prints label. But,after I add msgbox in script assistant in a template, I go back to the Text properties.

Then the msgbox display several times. It appears again...again..again.

I want to display Critical Message icon and click OK. That's all. 

MsgBox ("Stop printing!", 16, "Warning Message")

Not good in VB, so...hope to find help here.

Bartender Version 10.0 SR4

4 commentaires

1
Avatar
Pete Thane
Actions pour les commentaires Permalien

Been a long time since I have used v10.0 but it sounds like you need to set the VB up as an Event Controlled Script routine so that it appears as a specific point in the printing process

0
Avatar
Danny chuang
Actions pour les commentaires Permalien

Thanks for reply.

I have used VB script in "Event Controlled Script". But, it appears so many times.

How can I make the message appearing once?

For example... 

ShipCode is value. And I want the message only appearing if ShipCode is blank.

if len(Field("AX_OuterBox.Ship to Code")) = 0 then
value = MsgBox ("Stop printing!", 16, "Warning Message")
end if

0
Avatar
Pete Thane
Actions pour les commentaires Permalien

Value = Field("AX_OuterBox.Ship to Code").Value         >>>>>>>>>>>> click on the name of your database field to add this to to the Value=

Value1 = len(Value)

if Value1 = 0 then
value2 = MsgBox ("Stop printing!", 16, "Warning Message")

Else Value = Value
end if

 

Please note that although the message appears and the user click OK, BarTender continues to print so you would need to build in something that stops this. Conditional Printing could be enabled in later version so BarTender etc but not sure in v10.0.

However, couldn't you just add a filter/query in your database connection so that records that have a blank AX_OuterBox.Ship to Code can not be selected?

Although your v10.0 Database screen will look slightly different from the below but as you can see record 1002 is not appearing on the list as the AX... field is empty

 

0
Avatar
Danny chuang
Actions pour les commentaires Permalien

Hi Pete Thane

Appreciated. I had tried the first solution for several days. But, it didn't work. So I posted my first time reply for help again.

Afterward, I realized where the problem probably is because I added the VB script in "OnPrintEnd" in "Event Control Scripts".

It's because I used a script to stop printing when the value(ShipToCode) is blank.

So I changed the place of the script to "OnPrintStart" in "Event Control Scripts".

It’s working now. And it appears only once without endless loop.

The second solution in the database, noted with thanks. I may have used it someday.

Thank you so much.

 

Vous devez vous connecter pour laisser un commentaire.