VBScript not assigning values.

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
Dr.Phlox
Newcomer
Posts: 2
Joined: Wed Dec 19, 2018 2:01 pm

VBScript not assigning values.

Post by Dr.Phlox » Wed Dec 19, 2018 2:27 pm

Good afternoon!

I'm having a rather peculiar problem:

I'm using a VBScript to switch between German and French text on my label. I used the exact same Code on a different Label, I just renamed some Data Source variables. It works perfectly fine there.
For that I'm using multiple variables, this is what the code approximately looks like:

Code: Select all

Dim LANG 
Dim DescrDE 
Dim DescrFR 
Dim QtyDE 
Dim QtyFR 
Dim ColorDE 
Dim ColorFR 
Dim ArtNoDE
Dim ArtNoFR 
Dim ColorWertDE 
Dim ColorWertFR

LANG = [Language]
DescrDE = [SQLVALUES.DESCRIPTION_DE]
DescrFR = [SQLVALUES.DESCRIPTION_FR]
QtyDE = "Menge"
QtyFR = "Quantité"
ColorDE = "Farbe"
ColorFR = "Couleur"
ArtNoDE = "Artikelnummer"
ArtNoFR = "Numéro d'article"
ColorWertDE = [SQLVALUES.COLOR_DE]
ColorWertFR = [SQLVALUES.COLOR_FR]


If LANG = "DE" Then
[Beschreibung] = DescrDE
[AnzahlLabel] = QtyDE
[FarbeLabel] = ColorDE
[ArtikelnummerLabel] = ArtNoDE
[Farbe] = ColorWertDE


Else 
[Beschreibung] = DescrFR
[AnzahlLabel] = QtyFR
[FarbeLabel] = ColorFR
[ArtikelnummerLabel] = ArtNoFR
[Farbe] = ColorWertFR
End If
Now, the values I assign are shown in the Designers Preview:

Image

However, as soon as I switch to printing, the values are no longer shown. If I tick the box "Value Required", I get an error that it's empty.

Image

What I have tried so far:
  • Check if they're Phantoms
  • Check if their visibility is depending on another variable
  • If another variable interferes
  • If my SQL is interfering
  • If my Syntax is correct
I'm at a loss at this point, I have been hunting for an error for the past 3 hours and had 2 other coworkers check my work and nobody can find a mistake. ](*,)

I hope somebody here can help me!

User avatar
Kyleodonnell
NiceLabel Support
NiceLabel Support
Posts: 437
Joined: Mon Aug 28, 2017 3:07 pm

Re: VBScript not assigning values.

Post by Kyleodonnell » Wed Dec 19, 2018 4:46 pm

Dr.Phlox,

We recommend opening a support case with the support team https://www.nicelabel.com/support/technical-support as the team will need all of your files to test your solution.

Dr.Phlox
Newcomer
Posts: 2
Joined: Wed Dec 19, 2018 2:01 pm

Re: VBScript not assigning values.

Post by Dr.Phlox » Thu Dec 20, 2018 8:25 am

Nevermind, I forgot to drag the function on to the Label. That was the rpoblem.

Post Reply