bscruggs99 has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.
  • Comment on inserting checkboxes into yes/no field in Access

Replies are listed 'Best First'.
Re: inserting checkboxes into yes/no field in Access
by simon.proctor (Vicar) on Apr 21, 2006 at 08:59 UTC
    A yes/no field in access works by you inserting a 1 or a 0. So don't try to insert text. Check your vars and then insert a '1' as appropriate.

    However, recall that if a checkbox is not checked then it won't appear in your CGI query variables.

    Unless you can switch to radio buttons (so testing for the 'off') you'll need to makre sure you have the correct logic. Ie: if this query variable isn't present then insert 0.

    Or alternatively ensure all your yes/no fields default to 'off'.

    HTH

    S
Re: inserting checkboxes into yes/no field in Access
by davido (Cardinal) on Apr 21, 2006 at 07:56 UTC

    What does this have to do with Perl? Do you have some code we can help you with, perhaps?


    Dave

      the code I'm using is
      read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $FORM{$name} = $value; } }
      It seems to be pretty standard so my question was about how that stores the info form the checkboxes. I've never dealt with checkboxes since getting involved with perl so I wasn't sure how perl handled it. Changing to radio buttons is easy enough so I'll check into that.
Re: inserting checkboxes into yes/no field in Access
by eric256 (Parson) on Apr 21, 2006 at 13:20 UTC

    If you are handling the data in perl, be warned that some version of Access seem to store 1,0 as true,false while a very close other version stores it at -1,0. I'm not sure of specifics but i do know its driven me crazy in the past. Might have something to do with the fact that i was using MySQL as the backend for Access.


    ___________
    Eric Hodges