Skip to main content
Inspiring
June 27, 2006
Question

Show online checkbox only if checkbox is checked in db

  • June 27, 2006
  • 3 replies
  • 419 views
I have a table with about 40 checkboxes in a MS Access db.

I also have an online form (.asp) that people will use to search against
these checkbox fields. So if they check 'plum' and 'apple' only records with
both plum and apple checked will show on the results page. This works, but I
have a problem...

The problem is that some of the 40 checkbox fields may never get checked or
may get checked in a week a month a year... who knows.

I don't want the online user to be able to search (or even see) these on the
online form.

How do I make the form auto-magically show these checkboxes only when there
is at least one record in the table with that field checked?

Thanks for any help!

-Joe


This topic has been closed for replies.

3 replies

Inspiring
June 28, 2006
Joe

That makes it easier. Generally access stores yes/no fields in the database
as a 0 for No and -1 for yes.

What you need to do is create a query in Access, bring in each of the 40
fields and then select the total function and sum each field. Then use this
query as the source for a recordset on you form page. Call is rsTestSum

By default if you drag a field called Plum and the Sum it the new field is
called SumofPlum. Now for each of the checkboxs on you search form you sould
surround them with code like this

<% if rsTestSum.item("SumofPlum").value <> 0 then%>
<input type="checkbox" name="Plum" value="True">
<%End if%>


--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"Joe" <jthriftxxnospamxx@napavintners.com> wrote in message
news:e7ud4l$ksa$1@forums.macromedia.com...
> Yes. I have an online form with about 40 (non-dynamic, they are just for
> searching the db) checkboxes. My results page then gives the results of
> whatever group of boxes were checked.
>
>
>
> "Paul Whitham AdobeCommunityExpert" <design@valleybiz.net> wrote in
> message news:e7sa2a$2f$1@forums.macromedia.com...
>> Do each of the checkbox values correspond to a field in the database?
>>
>> --
>> Paul Whitham
>> Certified Dreamweaver MX2004 Professional
>> Adobe Community Expert - Dreamweaver
>>
>> Valleybiz Internet Design
>> www.valleybiz.net
>>
>> "Joe" <jthriftxxnospamxx@napavintners.com> wrote in message
>> news:e7q3fo$2le$1@forums.macromedia.com...
>>>I have a table with about 40 checkboxes in a MS Access db.
>>>
>>> I also have an online form (.asp) that people will use to search against
>>> these checkbox fields. So if they check 'plum' and 'apple' only records
>>> with both plum and apple checked will show on the results page. This
>>> works, but I have a problem...
>>>
>>> The problem is that some of the 40 checkbox fields may never get checked
>>> or may get checked in a week a month a year... who knows.
>>>
>>> I don't want the online user to be able to search (or even see) these on
>>> the online form.
>>>
>>> How do I make the form auto-magically show these checkboxes only when
>>> there is at least one record in the table with that field checked?
>>>
>>> Thanks for any help!
>>>
>>> -Joe
>>>
>>
>>
>
>


Inspiring
June 28, 2006
Yes. I have an online form with about 40 (non-dynamic, they are just for
searching the db) checkboxes. My results page then gives the results of
whatever group of boxes were checked.



"Paul Whitham AdobeCommunityExpert" <design@valleybiz.net> wrote in message
news:e7sa2a$2f$1@forums.macromedia.com...
> Do each of the checkbox values correspond to a field in the database?
>
> --
> Paul Whitham
> Certified Dreamweaver MX2004 Professional
> Adobe Community Expert - Dreamweaver
>
> Valleybiz Internet Design
> www.valleybiz.net
>
> "Joe" <jthriftxxnospamxx@napavintners.com> wrote in message
> news:e7q3fo$2le$1@forums.macromedia.com...
>>I have a table with about 40 checkboxes in a MS Access db.
>>
>> I also have an online form (.asp) that people will use to search against
>> these checkbox fields. So if they check 'plum' and 'apple' only records
>> with both plum and apple checked will show on the results page. This
>> works, but I have a problem...
>>
>> The problem is that some of the 40 checkbox fields may never get checked
>> or may get checked in a week a month a year... who knows.
>>
>> I don't want the online user to be able to search (or even see) these on
>> the online form.
>>
>> How do I make the form auto-magically show these checkboxes only when
>> there is at least one record in the table with that field checked?
>>
>> Thanks for any help!
>>
>> -Joe
>>
>
>


Inspiring
June 27, 2006
Do each of the checkbox values correspond to a field in the database?

--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"Joe" <jthriftxxnospamxx@napavintners.com> wrote in message
news:e7q3fo$2le$1@forums.macromedia.com...
>I have a table with about 40 checkboxes in a MS Access db.
>
> I also have an online form (.asp) that people will use to search against
> these checkbox fields. So if they check 'plum' and 'apple' only records
> with both plum and apple checked will show on the results page. This
> works, but I have a problem...
>
> The problem is that some of the 40 checkbox fields may never get checked
> or may get checked in a week a month a year... who knows.
>
> I don't want the online user to be able to search (or even see) these on
> the online form.
>
> How do I make the form auto-magically show these checkboxes only when
> there is at least one record in the table with that field checked?
>
> Thanks for any help!
>
> -Joe
>