By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,404 Members | 2,512 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,404 IT Pros & Developers. It's quick & easy.

CheckBox Toggle - Access97.

P: n/a

I'm not a Newbie but I feel like one right now.

Here's what I did to reproduce a simple, simple problem.

1. Create a new Database.
2. Create a new Form.
3. Create a CheckBox on the form. (Check0)
4. Set the DefaultValue to True

5. In the OnClick Event, put the code:

Me!Check0 = Not Me!Check0

6. Save and Open the Form.

7. Click the CheckBox more times than a sane mane really should.

My problem is _not_ that I expected the "Tick" to come and go, come
and go, but instead see it sit there sullenly, refusing to budge.

My problem is that in about ten years of playing with Access, from
Access 2 until now, I'm SURE I must have used a click in an unbound
checkbox for something or other and had it behave as I'd expect.

I tried some of the "Oh, I forgot to.." kind of thing, such as
Me.Repaint and Me!Check0.Value, and I verified that it was my head (not
Access) that was broken by throwing on Command2 which simply repeated the
same code:

Sub Command2_Click()
Me!Check0 = Not Me!Check0
End Sub

That cheered up the CheckBox "Tick" no end, coming and going with each
successive click just as it ought.

In short (sorry, to late!)

I want an unbound CheckBox Check0 with Me!Check0 = Not Me!Check0 in the
click event and a Default Value of True to toggle from True to False when I
click the Control.

Please, could some kind person gently explain the blindingly obvious thing
I've overlooked?

Cheers,
Alan Carpenter
Nov 13 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Not sure what behavior you expect, when clicking the check box toggles its
value, and your code toggles it back?

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Alan Carpenter" <al****@ihug.co.nz> wrote in message
news:ci**********@lust.ihug.co.nz...

I'm not a Newbie but I feel like one right now.

Here's what I did to reproduce a simple, simple problem.

1. Create a new Database.
2. Create a new Form.
3. Create a CheckBox on the form. (Check0)
4. Set the DefaultValue to True

5. In the OnClick Event, put the code:

Me!Check0 = Not Me!Check0

6. Save and Open the Form.

7. Click the CheckBox more times than a sane mane really should.

My problem is _not_ that I expected the "Tick" to come and go, come
and go, but instead see it sit there sullenly, refusing to budge.

My problem is that in about ten years of playing with Access, from
Access 2 until now, I'm SURE I must have used a click in an unbound
checkbox for something or other and had it behave as I'd expect.

I tried some of the "Oh, I forgot to.." kind of thing, such as
Me.Repaint and Me!Check0.Value, and I verified that it was my head (not
Access) that was broken by throwing on Command2 which simply repeated the
same code:

Sub Command2_Click()
Me!Check0 = Not Me!Check0
End Sub

That cheered up the CheckBox "Tick" no end, coming and going with each
successive click just as it ought.

In short (sorry, to late!)

I want an unbound CheckBox Check0 with Me!Check0 = Not Me!Check0 in the
click event and a Default Value of True to toggle from True to False when
I
click the Control.

Please, could some kind person gently explain the blindingly obvious thing
I've overlooked?

Cheers,
Alan Carpenter

Nov 13 '05 #2

P: n/a
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in
news:41***********************@per-qv1-newsreader-01.iinet.net.au:
Not sure what behavior you expect, when clicking the check box toggles
its value, and your code toggles it back?


AAAAAAAAARGGGHHHH!!!!!!!!!!!!

That's it, I'm now officially senile.

Please send soft toys and soft food c/o that guy over there with the white
coat.

Thanks, Allen. I'm a moron. I'm workin in too many differnt things and I'd
simply forgotten that Access did it for me without code.

Cheers,
Alan Carpenter
Nov 13 '05 #3

P: n/a
Hi,

I don't wish to appear argumentative; but why do you need any code?
Isn't the basic nature of the checkbox to check/uncheck on each
keypress? Delete the code and see what happens.

using A97

JimA
Alan Carpenter <al****@ihug.co.nz> wrote in message news:<ci**********@lust.ihug.co.nz>...
I'm not a Newbie but I feel like one right now.

Here's what I did to reproduce a simple, simple problem.

1. Create a new Database.
2. Create a new Form.
3. Create a CheckBox on the form. (Check0)
4. Set the DefaultValue to True

5. In the OnClick Event, put the code:

Me!Check0 = Not Me!Check0

6. Save and Open the Form.

7. Click the CheckBox more times than a sane mane really should.

My problem is _not_ that I expected the "Tick" to come and go, come
and go, but instead see it sit there sullenly, refusing to budge.

My problem is that in about ten years of playing with Access, from
Access 2 until now, I'm SURE I must have used a click in an unbound
checkbox for something or other and had it behave as I'd expect.

I tried some of the "Oh, I forgot to.." kind of thing, such as
Me.Repaint and Me!Check0.Value, and I verified that it was my head (not
Access) that was broken by throwing on Command2 which simply repeated the
same code:

Sub Command2_Click()
Me!Check0 = Not Me!Check0
End Sub

That cheered up the CheckBox "Tick" no end, coming and going with each
successive click just as it ought.

In short (sorry, to late!)

I want an unbound CheckBox Check0 with Me!Check0 = Not Me!Check0 in the
click event and a Default Value of True to toggle from True to False when I
click the Control.

Please, could some kind person gently explain the blindingly obvious thing
I've overlooked?

Cheers,
Alan Carpenter

Nov 13 '05 #4

P: n/a
JA*****@LeddyGroup.Com (Jim Allard) wrote in
news:74**************************@posting.google.c om:
Hi,

I don't wish to appear argumentative; but why do you need any code?
Isn't the basic nature of the checkbox to check/uncheck on each
keypress? Delete the code and see what happens.

using A97

JimA


No time to reply - I haven't finished kicking myself yet.

It was just a slight case (slight?) of brain-fade and language mix-up.

No offecne given or taken - both you and Allen were MUCH more polite than
my friends when I told them what I'd done. This morning I found my old
Commodore 64 on my desk nstead of my usual machine.

Sigh.

Alan "Never going to live it down) Carpenter

Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.