PC Review


Reply
Thread Tools Rate Thread

another checkbox question

 
 
=?Utf-8?B?SG9nbWFu?=
Guest
Posts: n/a
 
      17th Feb 2006
If I set a default value of a checkbox to 6 and I uncheck the box it gets set
to 0. Is there a way to set the value back to 6 if I recheck the box?
 
Reply With Quote
 
 
 
 
tina
Guest
Posts: n/a
 
      17th Feb 2006
probably i wouldn't try. better to stick with the standard numeric values
for the Boolean Yes/No, that is -1 and 0. why do you want a value of 6 for
Yes? perhaps we can help you find a solution that doesn't require deviation
from the standard.

hth


"Hogman" <(E-Mail Removed)> wrote in message
news:B9DD06FD-40ED-4623-A1B8-(E-Mail Removed)...
> If I set a default value of a checkbox to 6 and I uncheck the box it gets

set
> to 0. Is there a way to set the value back to 6 if I recheck the box?



 
Reply With Quote
 
=?Utf-8?B?SG9nbWFu?=
Guest
Posts: n/a
 
      17th Feb 2006
Tina, thanks for your response. On a form that I have as the front end to a
report I want to display eight options or variables that, if checked or
selected, will set each to a different value. If not checked, 0 is an
acceptable value. But if checked I need to set the variable to its
appropriate value 1 - 8. The form then calls a report which uses a query
where I have set the criteria for one of the data elements to something like
this:
[Forms]![ReportForm]![Field1] Or [Forms]![ReportForm]![Field2] Or
[Forms]![ReportForm]![Field3] and so on up to Field8.
If I can do it this way it eliminates the need to populate the variables
that I want set on any given occasion.

Thanks again for your help.


"tina" wrote:

> probably i wouldn't try. better to stick with the standard numeric values
> for the Boolean Yes/No, that is -1 and 0. why do you want a value of 6 for
> Yes? perhaps we can help you find a solution that doesn't require deviation
> from the standard.
>
> hth
>
>
> "Hogman" <(E-Mail Removed)> wrote in message
> news:B9DD06FD-40ED-4623-A1B8-(E-Mail Removed)...
> > If I set a default value of a checkbox to 6 and I uncheck the box it gets

> set
> > to 0. Is there a way to set the value back to 6 if I recheck the box?

>
>
>

 
Reply With Quote
 
tina
Guest
Posts: n/a
 
      17th Feb 2006
i'd probably add an invisible, unbound textbox for each checkbox on the
form. name them txt1, txt2, txt3...txt8. add the following procedure to your
form's module, as

Private Sub isAssignValue(ByVal num As String)

If Screen.ActiveControl Then
Me.Controls("txt" & num) = num
Else
Me.Controls("txt" & num) = 0
End If

End Sub

add code to the Click event of the "Field1" checkbox, as

isAssignValue 1

add code to the Click event of the "Field2" checkbox, as

isAssignValue 2

and so on, for each checkbox. in the query, change the criteria to

[Forms]![ReportForm]![txt1] Or [Forms]![ReportForm]![txt2] Or
[Forms]![ReportForm]![txt3] and so on up to txt8.

hth


"Hogman" <(E-Mail Removed)> wrote in message
news:1050AE3F-1460-48D4-988F-(E-Mail Removed)...
> Tina, thanks for your response. On a form that I have as the front end to

a
> report I want to display eight options or variables that, if checked or
> selected, will set each to a different value. If not checked, 0 is an
> acceptable value. But if checked I need to set the variable to its
> appropriate value 1 - 8. The form then calls a report which uses a query
> where I have set the criteria for one of the data elements to something

like
> this:
> [Forms]![ReportForm]![Field1] Or [Forms]![ReportForm]![Field2] Or
> [Forms]![ReportForm]![Field3] and so on up to Field8.
> If I can do it this way it eliminates the need to populate the variables
> that I want set on any given occasion.
>
> Thanks again for your help.
>
>
> "tina" wrote:
>
> > probably i wouldn't try. better to stick with the standard numeric

values
> > for the Boolean Yes/No, that is -1 and 0. why do you want a value of 6

for
> > Yes? perhaps we can help you find a solution that doesn't require

deviation
> > from the standard.
> >
> > hth
> >
> >
> > "Hogman" <(E-Mail Removed)> wrote in message
> > news:B9DD06FD-40ED-4623-A1B8-(E-Mail Removed)...
> > > If I set a default value of a checkbox to 6 and I uncheck the box it

gets
> > set
> > > to 0. Is there a way to set the value back to 6 if I recheck the box?

> >
> >
> >



 
Reply With Quote
 
=?Utf-8?B?SG9nbWFu?=
Guest
Posts: n/a
 
      17th Feb 2006
Tina,

Thank you soooo much! It works perfectly. It's nice to see people like you
so willing to help the novices, like myself, out here..

"tina" wrote:

> i'd probably add an invisible, unbound textbox for each checkbox on the
> form. name them txt1, txt2, txt3...txt8. add the following procedure to your
> form's module, as
>
> Private Sub isAssignValue(ByVal num As String)
>
> If Screen.ActiveControl Then
> Me.Controls("txt" & num) = num
> Else
> Me.Controls("txt" & num) = 0
> End If
>
> End Sub
>
> add code to the Click event of the "Field1" checkbox, as
>
> isAssignValue 1
>
> add code to the Click event of the "Field2" checkbox, as
>
> isAssignValue 2
>
> and so on, for each checkbox. in the query, change the criteria to
>
> [Forms]![ReportForm]![txt1] Or [Forms]![ReportForm]![txt2] Or
> [Forms]![ReportForm]![txt3] and so on up to txt8.
>
> hth
>
>
> "Hogman" <(E-Mail Removed)> wrote in message
> news:1050AE3F-1460-48D4-988F-(E-Mail Removed)...
> > Tina, thanks for your response. On a form that I have as the front end to

> a
> > report I want to display eight options or variables that, if checked or
> > selected, will set each to a different value. If not checked, 0 is an
> > acceptable value. But if checked I need to set the variable to its
> > appropriate value 1 - 8. The form then calls a report which uses a query
> > where I have set the criteria for one of the data elements to something

> like
> > this:
> > [Forms]![ReportForm]![Field1] Or [Forms]![ReportForm]![Field2] Or
> > [Forms]![ReportForm]![Field3] and so on up to Field8.
> > If I can do it this way it eliminates the need to populate the variables
> > that I want set on any given occasion.
> >
> > Thanks again for your help.
> >
> >
> > "tina" wrote:
> >
> > > probably i wouldn't try. better to stick with the standard numeric

> values
> > > for the Boolean Yes/No, that is -1 and 0. why do you want a value of 6

> for
> > > Yes? perhaps we can help you find a solution that doesn't require

> deviation
> > > from the standard.
> > >
> > > hth
> > >
> > >
> > > "Hogman" <(E-Mail Removed)> wrote in message
> > > news:B9DD06FD-40ED-4623-A1B8-(E-Mail Removed)...
> > > > If I set a default value of a checkbox to 6 and I uncheck the box it

> gets
> > > set
> > > > to 0. Is there a way to set the value back to 6 if I recheck the box?
> > >
> > >
> > >

>
>
>

 
Reply With Quote
 
tina
Guest
Posts: n/a
 
      17th Feb 2006
you're welcome, glad it worked for you!


"Hogman" <(E-Mail Removed)> wrote in message
news4D426A2-8A59-4C92-9AE6-(E-Mail Removed)...
> Tina,
>
> Thank you soooo much! It works perfectly. It's nice to see people like

you
> so willing to help the novices, like myself, out here..
>
> "tina" wrote:
>
> > i'd probably add an invisible, unbound textbox for each checkbox on the
> > form. name them txt1, txt2, txt3...txt8. add the following procedure to

your
> > form's module, as
> >
> > Private Sub isAssignValue(ByVal num As String)
> >
> > If Screen.ActiveControl Then
> > Me.Controls("txt" & num) = num
> > Else
> > Me.Controls("txt" & num) = 0
> > End If
> >
> > End Sub
> >
> > add code to the Click event of the "Field1" checkbox, as
> >
> > isAssignValue 1
> >
> > add code to the Click event of the "Field2" checkbox, as
> >
> > isAssignValue 2
> >
> > and so on, for each checkbox. in the query, change the criteria to
> >
> > [Forms]![ReportForm]![txt1] Or [Forms]![ReportForm]![txt2] Or
> > [Forms]![ReportForm]![txt3] and so on up to txt8.
> >
> > hth
> >
> >
> > "Hogman" <(E-Mail Removed)> wrote in message
> > news:1050AE3F-1460-48D4-988F-(E-Mail Removed)...
> > > Tina, thanks for your response. On a form that I have as the front

end to
> > a
> > > report I want to display eight options or variables that, if checked

or
> > > selected, will set each to a different value. If not checked, 0 is an
> > > acceptable value. But if checked I need to set the variable to its
> > > appropriate value 1 - 8. The form then calls a report which uses a

query
> > > where I have set the criteria for one of the data elements to

something
> > like
> > > this:
> > > [Forms]![ReportForm]![Field1] Or [Forms]![ReportForm]![Field2] Or
> > > [Forms]![ReportForm]![Field3] and so on up to Field8.
> > > If I can do it this way it eliminates the need to populate the

variables
> > > that I want set on any given occasion.
> > >
> > > Thanks again for your help.
> > >
> > >
> > > "tina" wrote:
> > >
> > > > probably i wouldn't try. better to stick with the standard numeric

> > values
> > > > for the Boolean Yes/No, that is -1 and 0. why do you want a value of

6
> > for
> > > > Yes? perhaps we can help you find a solution that doesn't require

> > deviation
> > > > from the standard.
> > > >
> > > > hth
> > > >
> > > >
> > > > "Hogman" <(E-Mail Removed)> wrote in message
> > > > news:B9DD06FD-40ED-4623-A1B8-(E-Mail Removed)...
> > > > > If I set a default value of a checkbox to 6 and I uncheck the box

it
> > gets
> > > > set
> > > > > to 0. Is there a way to set the value back to 6 if I recheck the

box?
> > > >
> > > >
> > > >

> >
> >
> >



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Checkbox Question Duncs Microsoft Access 6 5th Oct 2009 07:20 PM
Yes/No Checkbox Question POINTBLANK0704 Microsoft Access Getting Started 1 5th Oct 2009 01:06 AM
Checkbox question TotallyConfused Microsoft Excel Programming 6 18th Sep 2009 01:14 PM
Checkbox Question slow386 Microsoft Excel Misc 7 21st Jul 2007 12:06 AM
Master-Detail Datagrid -checkbox (once tick the checkbox, all the child checkbox is ticked) Agnes Microsoft VB .NET 0 16th Aug 2004 11:23 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:01 AM.