Two Different Data Formats From One Linked Field Follow

0
Avatar
Legacy Poster

On our label we have a date field that is populated via the Data Entry Form at print, format of the date field is MM/DD/YY. We also have a GS1-128 barcode that used the same date as part of the barcode but the format of the date is YYMMDD. We are trying to use the same user prompt from the Data Entry Form populate both fields. We are able to pass the values but the format of the date will not stay independent. If we change the format of the date in the barcode to Custom YYMMdd it changes the format of the text field for the same format. 

 

Any ideas on how we can accomplish getting the same values in different formats in the two fields using one user input?

 

Thanks!

5 comments

0
Avatar
Ian Cummings
Moderator
Comment actions Permalink

In one of the items use a VB Script to refer to the named data source in the other.  The VB script can then be set to format the date value as needed.

0
Avatar
vicki wordsworth
Comment actions Permalink

hoping someone can explain this further... i have no idea how VB script works.

I have a date field on my label in the format of MMM YY and the barcode date needs to be yymmdd.

what do you mean by refer to the named data source in the other. and how do i set the format in the VB script.  

thanks

0
Avatar
Pete Thane
Comment actions Permalink

Hi Vicki,

I am assuming the date maybe database connections of Data Entry forms in use in the information below

 

  • Go into the Properties of your barcode and select the yyMMdd substring. 
  • In the Data Source tab on the right hand side click on the Change Data Source Name button and on the new screen give the field a name (with no gaps in it) such as thisdate
  • Click Ok and Close to come out of the barcode and then go into the Properties of your Text field
  • Change the Type to Visual Basic Script and Event Controlled Script and the press the Edit with Script Editor button
  • A new screen will appear and in the new big box in the middle delete what is there and type Value = "Oct 2018" to give the field a dummy value
  • In the column on the left select the 4th option down to the one highlighted, namely OnPostPrompt and the box in the middle will change to a blank box
  • In that box type Value = 
  • Now in the column on the right double click on the name of the field you set above and so the box in the middle should now change to something like

Value = Format.NamedSubStrings("thisdate").Value

  • press Enter to start a new line and then copy and paste the following lines of code into the box

Value1 = Left(Value,2)

Value2 = Left(Value,4)

Value2 = Right(Value2,2)

Value2 = MonthName(Value2,True)

Value = Value2&Value1

  • If you want a space between the Oct and the 18 then amend the last line to

Value = Value2&" "&Value1

  • If you need the month to be in upper case (OCT not Oct) then add the following line before the last Value= line

Value2 = UCase(Value2)

  • When complete click Close and OK and test as required

Pete

 

0
Avatar
vicki wordsworth
Comment actions Permalink

Thanks Pete

Unfortunately i still can't get this to work.

 

any other ideas?  thanks again  is there a way i can show you my file by any chance?

Vicki

0
Avatar
Pete Thane
Comment actions Permalink

Hi Vicki,

You could email me a copy of your label and some detailed notes about what you are trying to achieve and i can take a look.

Pete

 

info (at) dcatonline.co.uk

Please sign in to leave a comment.