PC Review


Reply
Thread Tools Rate Thread

Checkbox result help

 
 
=?Utf-8?B?RGF0YW1laXN0ZXI=?=
Guest
Posts: n/a
 
      22nd Mar 2007
When a checkbox on my form is checked (yes/true), I would like the result in
the corresponding field to be an "X". When it is not checked I would like
the result to simply remain blank.

I am working with a database in which the user simply typed the "X" in
either the table or form and I am trying to convert it to a checkbox on the
form.

I'm sure this question has been answered before but I haven't found it yet
or don't understand exactly what to do.

Thanks for your help in advance.
 
Reply With Quote
 
 
 
 
storrboy
Guest
Posts: n/a
 
      22nd Mar 2007
Run an Update query to convert x's to -1, blanks, nulls and other non-
trues to 0.
Change the datatype on the field to boolean.
Use checkboxes (or other control good for booleans) in all cases where
this field can be updated.

Absolutely ban with punishment of death people from editing directly
in tables.

 
Reply With Quote
 
=?Utf-8?B?RGF0YW1laXN0ZXI=?=
Guest
Posts: n/a
 
      22nd Mar 2007
Thank you for your reply.

I truely appreciate your help and I appreciate the fact that you are trying
to help people design their database in the best way, however this did not
answer my question as to how to produce an "X". I might use your suggestion
in the end, however at this time I would prefer to have an "X".

"storrboy" wrote:

> Run an Update query to convert x's to -1, blanks, nulls and other non-
> trues to 0.
> Change the datatype on the field to boolean.
> Use checkboxes (or other control good for booleans) in all cases where
> this field can be updated.
>
> Absolutely ban with punishment of death people from editing directly
> in tables.
>
>

 
Reply With Quote
 
fredg
Guest
Posts: n/a
 
      22nd Mar 2007
On Thu, 22 Mar 2007 11:20:05 -0700, Datameister wrote:

> When a checkbox on my form is checked (yes/true), I would like the result in
> the corresponding field to be an "X". When it is not checked I would like
> the result to simply remain blank.
>
> I am working with a database in which the user simply typed the "X" in
> either the table or form and I am trying to convert it to a checkbox on the
> form.
>
> I'm sure this question has been answered before but I haven't found it yet
> or don't understand exactly what to do.
>
> Thanks for your help in advance.


Code the Check Box AfterUpdate event:
If Me![CheckBoxName] = True then
[Me![OtherControlName] = "X"
Else
[Me![OtherControlName] = Null
End If

Note: This will not change existing data in the field, only when you
check or uncheck the check box.

I would also suggest you set the enabled property of
[OtherControlName] to No to prevent a user from over-writing the
value.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
 
Reply With Quote
 
=?Utf-8?B?RGF0YW1laXN0ZXI=?=
Guest
Posts: n/a
 
      23rd Mar 2007
I had to play with the syntax a little but this does produce the "X". Thanks
much! The only problem is that I can check the box the first time, it turns
grey rather than a check, and I can't uncheck it. Please help!

"fredg" wrote:

> On Thu, 22 Mar 2007 11:20:05 -0700, Datameister wrote:
>
> > When a checkbox on my form is checked (yes/true), I would like the result in
> > the corresponding field to be an "X". When it is not checked I would like
> > the result to simply remain blank.
> >
> > I am working with a database in which the user simply typed the "X" in
> > either the table or form and I am trying to convert it to a checkbox on the
> > form.
> >
> > I'm sure this question has been answered before but I haven't found it yet
> > or don't understand exactly what to do.
> >
> > Thanks for your help in advance.

>
> Code the Check Box AfterUpdate event:
> If Me![CheckBoxName] = True then
> [Me![OtherControlName] = "X"
> Else
> [Me![OtherControlName] = Null
> End If
>
> Note: This will not change existing data in the field, only when you
> check or uncheck the check box.
>
> I would also suggest you set the enabled property of
> [OtherControlName] to No to prevent a user from over-writing the
> value.
> --
> Fred
> Please respond only to this newsgroup.
> I do not reply to personal e-mail
>

 
Reply With Quote
 
=?Utf-8?B?RGF0YW1laXN0ZXI=?=
Guest
Posts: n/a
 
      23rd Mar 2007
I discovered the problem.
> "fredg" wrote:
> > [Me![OtherControlName] = "X"

The "OtherControl" already existed and I had the controlsource the same for
both the checkbox and "OtherControl". Checkbox trying to put in a -1 at the
same time "OtherControl" trying to put in X.

Once more thanks for the help with the check box issue!!


> "fredg" wrote:
>
> > On Thu, 22 Mar 2007 11:20:05 -0700, Datameister wrote:
> >
> > > When a checkbox on my form is checked (yes/true), I would like the result in
> > > the corresponding field to be an "X". When it is not checked I would like
> > > the result to simply remain blank.
> > >
> > > I am working with a database in which the user simply typed the "X" in
> > > either the table or form and I am trying to convert it to a checkbox on the
> > > form.
> > >
> > > I'm sure this question has been answered before but I haven't found it yet
> > > or don't understand exactly what to do.
> > >
> > > Thanks for your help in advance.

> >
> > Code the Check Box AfterUpdate event:
> > If Me![CheckBoxName] = True then
> > [Me![OtherControlName] = "X"
> > Else
> > [Me![OtherControlName] = Null
> > End If
> >
> > Note: This will not change existing data in the field, only when you
> > check or uncheck the check box.
> >
> > I would also suggest you set the enabled property of
> > [OtherControlName] to No to prevent a user from over-writing the
> > value.
> > --
> > Fred
> > Please respond only to this newsgroup.
> > I do not reply to personal e-mail
> >

 
Reply With Quote
 
fredg
Guest
Posts: n/a
 
      23rd Mar 2007
On Fri, 23 Mar 2007 11:30:12 -0700, Datameister wrote:

> I had to play with the syntax a little but this does produce the "X". Thanks
> much! The only problem is that I can check the box the first time, it turns
> grey rather than a check, and I can't uncheck it. Please help!
>
> "fredg" wrote:
>
>> On Thu, 22 Mar 2007 11:20:05 -0700, Datameister wrote:
>>
>>> When a checkbox on my form is checked (yes/true), I would like the result in
>>> the corresponding field to be an "X". When it is not checked I would like
>>> the result to simply remain blank.
>>>
>>> I am working with a database in which the user simply typed the "X" in
>>> either the table or form and I am trying to convert it to a checkbox on the
>>> form.
>>>
>>> I'm sure this question has been answered before but I haven't found it yet
>>> or don't understand exactly what to do.
>>>
>>> Thanks for your help in advance.

>>
>> Code the Check Box AfterUpdate event:
>> If Me![CheckBoxName] = True then
>> [Me![OtherControlName] = "X"
>> Else
>> [Me![OtherControlName] = Null
>> End If
>>
>> Note: This will not change existing data in the field, only when you
>> check or uncheck the check box.
>>
>> I would also suggest you set the enabled property of
>> [OtherControlName] to No to prevent a user from over-writing the
>> value.
>> --
>> Fred
>> Please respond only to this newsgroup.
>> I do not reply to personal e-mail
>>


I'm not sure I understand your problem.
If you want specific help, you have to provide specific information.

What do you mean you 'had tp play with the syntax'?
What is the syntax you actually used?
Is the check box bound to a field in your table? It should be,
otherwise how will Access know which record gets the "X"?

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
 
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 Control - How to display a true or false value in the cellcontaining a checkbox Dave K Microsoft Excel Discussion 1 8th Sep 2010 08:31 PM
How to display an "x" or checkbox in place of text result =?Utf-8?B?RGlhbmFtNDE1?= Microsoft Access 2 8th Feb 2006 12:31 AM
show query result depending on checkbox =?Utf-8?B?VkI=?= Microsoft Access Queries 1 6th Nov 2005 05:05 PM
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
Change display result of checkbox Pedro Microsoft Outlook Form Programming 2 7th Jul 2003 04:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:09 PM.