Skip to main content

Search

Search

Adding two or more value

Comments

3 comments

  • Avatar
    Peter Thane

    Add the code to the OnNewRecord section rather than on AutoSelected and maybe add a default value here like Value = 99

    I am guessing the fields are concatenating rather than summing together and to do this you need to add a CInt command to each variable and so you end line would be 

    Value = CInt(Value1) + CInt(Value2)

    0
  • Avatar
    Rafael Seward

    So I added the command "value = "99" to the OnAutoSelectedEvent section and added the commands you recommended to the OnNewRecord section.

    Unfortunately I am still running into an issue. I am getting this error after I did the CInt command-

    OnNewRecord (Line 5):  Overflow: 'CInt'

    Also, I am trying to get the sum of these two values (1+1=2) so not sure it that involves another type of command or this current one. Thank you for the help thus far though!

     

    0
  • Avatar
    Peter Thane

    Both the fields you are adding need to be numeric only fields and so if they have an mg suffix in the data this will not work. If this is the case you will need to add them on a a numeric only field on the label template but to the side of the label so they do not print, name the data sources and then instead of linking Value1 and Value2 to the database fields link them to the named data sources instead. 

    This is what I get 

    0

Please sign in to leave a comment.