On Click Event execute Script

Issues related to label design (working with databases, data processing, RFID encoding etc.) and printing (from NiceLabel Express, NiceLabel Pro, NiceForm and NicePrint)

Moderators: Georges, milos, NiceLabel Support Team

Post Reply
Posts: 7
Joined: Mon May 05, 2014 11:14 am

On Click Event execute Script

Post by Spikenaylor » Wed Mar 25, 2020 5:03 pm

Hi there
in my On Click Event
I Open Label
Set the printer
Execute script
Print Label

in my Execute script section

If textbox = "" then
MsgBox " enter a number",48,"WARNING"


however I need the stop really to fully exit the On Click Event.

is there any way to acheive this

many thanks

User avatar
NiceLabel Support
NiceLabel Support
Posts: 167
Joined: Fri Jul 13, 2018 10:26 pm
Location: Milwaukee, Wisconsin

Re: On Click Event execute Script

Post by Mytch » Wed Mar 25, 2020 10:33 pm


I recommend you use native functionality provided within NiceLabel to accomplish this. For your Message Box, you can use the Action "Message" and have Enabled Condition so it only executes when TextBox = "" like you say:
2020-03-25_16h23_03.png (21.2 KiB) Viewed 890 times

And to "fully exit" the rest of the Event you just want to ignore the Print Label Action. So perhaps you can do so with another Enabled Condition:
2020-03-25_16h25_27.png (60.63 KiB) Viewed 890 times
So now if some textbox variable is blank, the Message Box will occur, and the Print Label will not. If the variable is not blank, then the Message is not shown and Print Label does occur.


Post Reply