Checkbox name is count and command button name is Update. When I click the
command button I want the checkbox to = true. I have tried these two things
and both tell me the the form is read only. Can someone please give me the
correct code?
update_on click
me.count = true
update_on click
if me.count = false then
me.count = true
else
me.count = false
end if
Marshall Barton - 05 Jun 2007 21:56 GMT
>Checkbox name is count and command button name is Update. When I click the
>command button I want the checkbox to = true. I have tried these two things
[quoted text clipped - 3 lines]
>update_on click
>me.count = true
That code would work if the form was updatable. Is the
form's record source table/query updatable? Have you done
something else to make it readonly? What is the check box's
control source?

Signature
Marsh
MVP [MS Access]
Douglas J. Steele - 05 Jun 2007 21:59 GMT
I'm guessing your form is using a query as its recordsource, and that query
isn't updatable.

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
> Checkbox name is count and command button name is Update. When I click
> the
[quoted text clipped - 13 lines]
> me.count = false
> end if
fredg - 05 Jun 2007 22:02 GMT
> Checkbox name is count and command button name is Update. When I click the
> command button I want the checkbox to = true. I have tried these two things
[quoted text clipped - 10 lines]
> me.count = false
> end if
If the form is 'Read Only" then you can't make changes.
Set the Form's AllowEdits property to Yes.
Note that opening this form froma an event, using the acFormReadOnly
argument in the OpenForms method, will over-ride the AllowEdits
property. You'll have to check this yourself.
Also, you're batting 2 for 2 in your use of Count and Update as field
names.
Count and Update are both reserved Access/VBA/Jet words and should not
be used as a field name.
For additional reserved words, see the Microsoft KnowledgeBase article
for your version of Access:
109312 'Reserved Words in Microsoft Access' for Access 97
209187 'ACC2000: Reserved Words in Microsoft Access'
286335 'ACC2002: Reserved Words in Microsoft Access'
321266 'ACC2002: Microsoft Jet 4.0 Reserved Words'
For an even more complete list of reserved words, see:
http://www.allenbrowne.com/AppIssueBadWord.html

Signature
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail