Jump to content
Server Maintenance This Week. ×

I'm stuck and out of time


wvdb

This topic is 5609 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I need to auto check a 2008 Holiday Card check box based on a found set. I also don't want to update any in the found set which may already have this box checked.

I've tried to use a loop with set field where the calculated value equals the current field & "2008 Holiday Cards" however this isn't working and I'm worried it may add the value to records that are already checked.

Any ideas?

Thanks

Link to comment
Share on other sites

Well, you will have to uncheck the box twice, if you want to remove the double value. I don't know what else you intend to do with this field, so I cannot tell what other repercussions it might have.

Why don't you constrain the found set before adding the value, or use a calculated result, e.g.

Checkbox & Case ( IsEmpty ( FilterValues ( "NewValue" ; Checkbox ) ) ; "¶NewValue" )

Link to comment
Share on other sites

A field formatted as a checkbox contains a return-separated value for each value checked, ie., multi-line. There are various ways to handle the result.

One is to use a global field, put a value in it, then use a self-relationship to the checkbox field to test for a match. This automatically only matches entire lines, so will not have false positives.

Alternatively you can use the PatternCount() function to test, in a Loop. But that will match the pattern anywhere in a line. So it depends what the value is whether that is going to be safe enough or not. The safest way to match is to add returns to both the field, and the value. Then it will only match entire lines, and it will not matter if it is the first or last line.

PatternCount ( ¶ & checkbox & ¶; ¶ & value & ¶ )

Or, as you say, omit them first. Though this would also depend on whether the Find result could have false positives. In your case, I doubt it ("2008 Holiday Cards").

But if you just set the field to itself & ¶ & value, then you could end up with the value in there twice, as 2 separate lines. It would only show in the checkboxes once. But it is kind of weird. (As comment said, especially when clearing the value.)

Edited by Guest
Link to comment
Share on other sites

This topic is 5609 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.