I don't recall outlining creating a Y/N field example in my book.

---
Sent from my Android phone



On December 22, 2016 6:20:26 AM Dave Britten <[email protected]> wrote:

Ah, that makes perfect sense. It hadn't even occurred to me to have a field recompute itself like that. (I think DP takes the crown for being the most programmable "non-programmable" database.) I had been spending some time scouring Ralph's book this morning, but I must have missed this, or didn't search for the right term. Thanks Paul.

-Dave Britten

On Dec 22, 2016, at 9:00 AM, [email protected] wrote:

Hi Dave:

You would use a formula on your field like the following (assumes your U1 field is P1F6):

if P1F6 = "Y" then "Y"
else if P1F6 = "N" then "N"
else ""
endif endif

Set validation to "Automatically computed at any change and when record is saved".

This won't allow any entry except Y or N to be saved.

Incidentally, be sure to find and download Ralph Alvy's book "Mastering DataPerfect" if you haven't already done so. It's a great guide to fully using DP.

Paul Durban


-------- Original Message --------
Subject: [Dataperf] Implementing a Y/N field (or: constraining a U1 field)
Date: 2016-12-22 08:39
From: Dave Britten <[email protected]>
To: DataPerfect Mailing List <[email protected]>

Howdy folks,

It seems like this ought to be a simple thing, but I'm just not quite getting there. I need to have a few fields that accept either "Y" or "N". U1 fields are the obvious choice. How can I constrain the user's input to only "Y" or "N"? Setting range validation on the field obviously won't do it, since you can't give a list of discontinuous values to validate against.

I tried adding a calculated field next to it that translates the "Y" and "N" to 1 and 0, and defaults to 2 for anything else, then putting 0-1 range validation on that. It sort of works if that surrogate field isn't hidden, but if it's hidden, the validation doesn't seem to run.

Is the simplest way to do this by creating a panel that holds the "Y" and "N" values, and using that as a target for no-create data links in the entry forms? I could swear I read something in passing about doing this kind of validation with field formulas and range validation, but I'm not having any success finding it now.

-Dave Britten
_______________________________________________
Dataperf mailing list
[email protected]
http://lists.dataperfect.nl/cgi-bin/mailman/listinfo/dataperf
_______________________________________________
Dataperf mailing list
[email protected]
http://lists.dataperfect.nl/cgi-bin/mailman/listinfo/dataperf
_______________________________________________
Dataperf mailing list
[email protected]
http://lists.dataperfect.nl/cgi-bin/mailman/listinfo/dataperf


_______________________________________________
Dataperf mailing list
[email protected]
http://lists.dataperfect.nl/cgi-bin/mailman/listinfo/dataperf

Reply via email to