Page Index Toggle Pages: 1 [2]  Send Topic Send Topic Print Print
Very Hot Topic (More than 25 Replies) [Solved] Undecided (Read 2646 times)
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: [Solved] Undecided
Reply #15 - Jan 31st, 2008 at 8:17pm
Print Post Print Post  
There is a difference between NULL and Blank. Sesame does not allow NULL values but does allow you to have blank values.
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: [Solved] Undecided
Reply #16 - Jan 31st, 2008 at 8:23pm
Print Post Print Post  
1. We have no NULLs. Rejoice!  Smiley

2. Checkboxes have three states because of questions like "Is the patient allergic to penicillin?" where Not Set and No are very different.

3. If checkboxes did not have the capacity to show a "Not Set" state, there would be no way in a Retrieve Spec to leave one "blank" and retrieve all values.

Please note that this is offered purely for informational purposes in case anyone is interested. I am not arguing that tri-state is "good" and bi-state is "bad" or anything like that. I am also not arguing that the presence of the third state is not a pain at times. Enjoy your flight and thank you for choosing Lantica Airlines.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: [Solved] Undecided
Reply #17 - Jan 31st, 2008 at 9:00pm
Print Post Print Post  
Quote:
That is because you are trying to use the Blank as the Off in them. If the records that are not On were actually set to be Off then the Searching would work the way that you want it to. Off would retrieve Off, On would retrieve On and Unset would retrieve everything.


OK, so it looks like if I want to be able to search for the presence of a check or not, I want all my boxes to be either checked or unchecked, and eliminate all blank states.  If that's the case then I need some advice.

I currently use checkboxes in two of my databases/forms.  In one of them it's not really critical if they're checked, unchecked, or blank.  In the other it is.  So I'll concentrate on that.  If I succeed I'll transition the other form as well, just for grins and giggles.

What I need to do first is program the database so that when one opens a new, blank record, the default "blank" value of the box is set to 0/No/unchecked.  That's easy enough, I think.  The element is "Check_If_Driver", so some combination of If @Add or If @IsNew and If @IsBlank(Check_If_Driver)=yes should do it.

Then I'll need to Mass Update all my current records so the blank boxes become 0/No/Off.  This is where it gets tricky.  I suppose I'll have to program a retrieve because I can't access the element directly to check its state, I can only find either all checked or all ALL.

Then I'll need to program the element so that if it's not On, it's Off.  The programming you've detailed above should do that.

Is there anything I'm missing in the above plan?  Also, it it possible to eliminate the "blank" option from a retrieve spec?

Thanks for your help.
  

**
Captain Infinity
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: [Solved] Undecided
Reply #18 - Jan 31st, 2008 at 9:08pm
Print Post Print Post  
Scott,

Just set an initial value of 0.

To find the ones that are not checked, at the retrieve spec just check the box and Run Inverted Search.

Then Mass Update them to be 0.

You'll want the blank option at the retrieve spec.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: [Solved] Undecided
Reply #19 - Jan 31st, 2008 at 9:15pm
Print Post Print Post  
Quote:
Just set an initial value of 0.

Ah, of course.  I'm overthinking it.
Quote:
To find the ones that are not checked, at the retrieve spec just check the box and Run Inverted Search.  Then Mass Update them to be 0.

Cool, I've never done that.  Can an inverse search be saved in the spec manager?
Quote:
You'll want the blank option at the retrieve spec.

Yes, I probably will.  But I'm pretty sure it would throw my users for a loop, and I'd have difficulty explaining it.  Heck, I have difficulty understanding it.
  

**
Captain Infinity
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: [Solved] Undecided
Reply #20 - Jan 31st, 2008 at 9:25pm
Print Post Print Post  
Infinity wrote on Jan 31st, 2008 at 9:15pm:
Cool, I've never done that.  Can an inverse search be saved in the spec manager?

No. It is a way of running a spec. It is not the spec itself.

Quote:
Quote:
You'll want the blank option at the retrieve spec.

Yes, I probably will.  But I'm pretty sure it would throw my users for a loop, and I'd have difficulty explaining it.  Heck, I have difficulty understanding it.

It will throw them for more of a loop when they are unable to leave it "blank" at the Retrieve Spec, thereby indicating that they  don't care about it for the purposes of the search. They are able to leave other fields blank and press F10. At the Retrieve Spec, the unset state for a checkbox acts just like leaving a field blank.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: [Solved] Undecided
Reply #21 - Jan 31st, 2008 at 9:28pm
Print Post Print Post  
Quote:
No. It is a way of running a spec. It is not the spec itself.

Shoot.  Saving it would be immensely useful.  Can it be programmed?

Quote:
It will throw them for more of a loop when they are unable to leave it "blank" at the Retrieve Spec, thereby indicating that they  don't care about it for the purposes of the search. They are able to leave other fields blank and press F10. At the Retrieve Spec, the unset state for a checkbox acts just like leaving a field blank.

I see what you mean.  Thank you.
  

**
Captain Infinity
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: [Solved] Undecided
Reply #22 - Jan 31st, 2008 at 9:31pm
Print Post Print Post  
Infinity wrote on Jan 31st, 2008 at 9:28pm:
Quote:
No. It is a way of running a spec. It is not the spec itself.

Shoot.  Saving it would be immensely useful.  Can it be programmed?

Sure.  Smiley
Although, if you just need to run it once to updated the unset ones, I'm not sure you'll need it all that often.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: [Solved] Undecided
Reply #23 - Jan 31st, 2008 at 9:50pm
Print Post Print Post  
Scott,

You need to come to the meeting Saturday. We can get you straightened out there.

  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
CapitalG
Full Member
Members
***
Offline



Posts: 143
Location: Phoenix, Arizona
Joined: Mar 4th, 2003
Re: [Solved] Undecided
Reply #24 - Feb 7th, 2008 at 10:28pm
Print Post Print Post  
I put the following code in the On Element Immediate Change for a checkbox element named "box".

Here is the code in the OEIC:

[code]If @IsBlank(ThisElement) Then
{
     ThisElement = 1
} [/code]

It worked great and only allowed on/off states.

When I set the default initial value to 0, I got the desired result of the inital value being off, but now it cycles through all three states.

Just to be sure it wasn't other programming, I created a new db with just a checkbox as the only element.  The results were the same.  

What am I doing wrong?

Thanks for the guidance

  
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: [Solved] Undecided
Reply #25 - Feb 7th, 2008 at 11:03pm
Print Post Print Post  
[quote author=CapitalG link=1194898158/0#24 date=1202423302]When I set the default initial value to 0, I got the desired result of the inital value being off, but now it cycles through all three states.[/quote]
Yeah, I don't know why, but if you use "No" rather than "0" for the initial value, it should work.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
CapitalG
Full Member
Members
***
Offline



Posts: 143
Location: Phoenix, Arizona
Joined: Mar 4th, 2003
Re: [Solved] Undecided
Reply #26 - Feb 8th, 2008 at 3:36pm
Print Post Print Post  
Thanks Carl

I thought I was going crazy.  I don't know why 0 doesn't work either.

Thanks
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send Topic Send Topic Print Print