Disabling checkboxes when an "approved" checkbox is checked

  • Thread starter Thread starter Rich
  • Start date Start date
R

Rich

I saw a thread from 2005 that seems like it will do what I want to do, but
I'm having troubled with it.

When the "approved" field is checked, I want all of the data in the form to
be greyed out so it can be viewed, but not edited. When I get this to work,
I will create an identical form ("user form") - minus the "approved" checkbox
(maybe it'll be better just to disable that checkbox??) - that users will use
to enter the data. When I review the data using the "master form", I check
"approved". At this point, users will be able to view the data, but not edit.

I have successfully used conditional formatting to disable listboxes and
textboxes. I can't get the other checkboxes to disable. I tried using
"fredg"s code from 9/23/05 as a guide, but I can't make it work.

I suspect that my problem comes from the "form's current event" that is
supposed to contain the same code as the "approved" checkbox's "afterupdate"
event. If I go to the form's properties, I dont see a "current event". I've
tried to put the code in the "onCurrent" event, but it doesn't work.

*****
Then code the AfterUpdate event of the first check box:

Me![CheckBox2].enabled = Me![CheckBox1]
Me![CheckBox3].enabled = Me![CheckBox1]
Me![CheckBox4].enabled = Me![CheckBox1]

Place the same code in the Form's Current event.
*****
my code for the "approved" checkbox AfterUpdate event is:
=[Incident Info].Enabled=Not [Approved]

Any help is appreciated. Thanks!!!
 
Rich said:
I saw a thread from 2005 that seems like it will do what I want to do, but
I'm having troubled with it.

When the "approved" field is checked, I want all of the data in the form to
be greyed out so it can be viewed, but not edited. When I get this to work,
I will create an identical form ("user form") - minus the "approved" checkbox
(maybe it'll be better just to disable that checkbox??) - that users will use
to enter the data. When I review the data using the "master form", I check
"approved". At this point, users will be able to view the data, but not edit.

I have successfully used conditional formatting to disable listboxes and
textboxes. I can't get the other checkboxes to disable. I tried using
"fredg"s code from 9/23/05 as a guide, but I can't make it work.

I suspect that my problem comes from the "form's current event" that is
supposed to contain the same code as the "approved" checkbox's "afterupdate"
event. If I go to the form's properties, I dont see a "current event". I've
tried to put the code in the "onCurrent" event, but it doesn't work.

*****
Then code the AfterUpdate event of the first check box:

Me![CheckBox2].enabled = Me![CheckBox1]
Me![CheckBox3].enabled = Me![CheckBox1]
Me![CheckBox4].enabled = Me![CheckBox1]

Place the same code in the Form's Current event.
*****
my code for the "approved" checkbox AfterUpdate event is:
=[Incident Info].Enabled=Not [Approved]


Sounds like you are confusing the Current event procedure
and the OnCurrent **property**. The property should be set
to:
[Event Procedure]
to tell Access to call the related event procedure (instead
of runnning a macro or calling a function).

If you select [Event Procedure] in the OnCurrent property,
and then click on the builder button (with 3 dots) on the
right, Access will bring up the code module and put the
cursor in the event's procedure where you can put the code.
 
Marshall,
Thanks!! That was the exactly my problem. Although I wasn't confusing a
property with an event....I just didn't know (and still don't) the
difference. No matter - it does work and I can now finish my little project.
;-)
 
Back
Top