Zum Hauptinhalt gehen

Suche

Suche

Change field content according to excell cell

Kommentare

3 Kommentare

  • Avatar
    Peter Thane

    is "Ring, 18karats, weight for 8 karats (empty), weight for 12 karats (empty), weight for 18 karats (30gr)," all in one cell or in multiple cells like the image below? 

     

    If mulitple then the process is fairly straight-forward as you can just add multiple sub-strings to your field and the empty ones will be blank and wont impact the label. 

    For example:

    Create a label field linked to say the 8 carat and then go into the Properties of that and use the copy and paste buttons at the bottom of the column on the left to add two new strings adjusting the filed drop down for each to amend which cell the data will come from:

     

    When printing the labels will look like this

    I hope this helps, 

    If the data is all in cell the process will be far more complex and VB would be needed but hopefully this isn't the case

     

    0
  • Avatar
    Christian Zamboni

    Dear Pete,

    thank you for your fast answer. Unfortunately my customer send me a different excell sheet where all weight cells are filled, so i need another solution dependin from the type i need to fill the weight field with the correct weight. Thank you again.

    0
  • Avatar
    Peter Thane

    This should do it

     

    You need to make the VB and Event Controlled Script to be processed OnNewRecord. I have pasted the code below too so you can see it more clearly. To create the VB type in the BOLD parts but to select the fields to use double click on the field name in the database field name section in the column on the right and that will add the correct links in.

    Value =Field("karat.Sheet1.Type")

    If Value = "8 carat" then
    Value = Field("karat.Sheet1.Weight for 8 carat")
    elseif Value = "10 carat" then
    Value = Field("karat.Sheet1.Weght for 10 carat")
    elseif Value = "18 carat" then
    Value = Field("karat.Sheet1.Weights for 18 carat")
    end if

    Value = Value

    0

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