Zum Hauptinhalt gehen

Suche

Suche

'add' Function

Kommentare

2 Kommentare

  • Avatar
    Fernando Ramos Miracle

    As the information from the "expirationplus" name data source is coming from a database field of "text" type you will probably need to apply a numeric conversion to it too. I would suggest you use CInt() instead of CDbl() to avoid decimals. Your code would look as follows:

     

    Value = CInt(Value) + CInt(Format.NamedSubStrings("expirationplus").Value)

     

    If you are using the data from a database why don't you use a reference to a database field directly? If you want to get only the rightmost characters of the data you could add the Right() function to your code.

     

    *The reason why you  don't get an error when testing is because you code is using the default value of your "expirationplus" named data source instead of the data from the database, as at that time no information from the database is being loaded. For instance if you use a direct reference to the database field you'll get an error when testing, as BarTender won't have access at that point to the database, only when printing or doing a print preview.

    0
  • Avatar
    Legacy Poster

    Hi Fernando,

    yes that did the trick. But there was an additional problem. I had a deeper look at it and noticed that this field was not updating at all with the information entered during printing time.
    So Value was always using the standard value. The Value from the database was ok.

    So i deleted the field and created it again as i was not able to find the problem within the field. And now it just works! :)
     

    Thank you very much!

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.