0

How to select different options in bulk?

I have a table, and I want to select 'Star' as 1 for all 'old code' less than 100, and as 2 for all 'old code' greater than 100. How should I write the code in the button? Thank you for your response.

(I've uploaded the database.)

3 replies

null
    • Fred
    • 2 wk ago
    • Reported - view

    If you only need to do this once then you can use the Bulk Edit and put this code in the Assigned calculated value part next to Star.

    if 'old code' < 100 then 1 else 2 end
    

    If you need it in a button then you can do:

    for loop1 in select inventory do
        loop1.(Star := if 'old code' < 100 then 1 else 2 end)
    end
    
      • gold_cat
      • 2 wk ago
      • Reported - view

       Thank you, Fred. I reviewed the 'for...in...do' command again.

      • Rafael Sanchis
      • Rafael_Sanchis
      • 2 wk ago
      • Reported - view

      Also work on Trigger After Update on 'old code' 

Content aside

  • Status Answered
  • 2 wk agoLast active
  • 3Replies
  • 35Views
  • 3 Following