Disable checkbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am posting this again because I don't think it went through the first time.
How can I get the following code to work with each individual record in my
subform?
It works but it effects check boxes in all records.
Thanks in advance
Alvin
------------Start My Code---------------
If Me.Accepted = -1 Then
Me.Rejected.Enabled = False
Me.Repair.Enabled = False
Me.RepairComplete.Enabled = False
Else
Me.Rejected.Enabled = True
Me.Repair.Enabled = True
Me.RepairComplete.Enabled = True

End If
-------------End My Code--------------------
 
If you have ac2K or > then Conditional Formating should work. By the way, your
code could also be written as:

Me.Rejected.Enabled = Not Me.Accepted
Me.Repair.Enabled = Not Me.Accepted
Me.RepairComplete.Enabled = Not Me.Accepted

I am posting this again because I don't think it went through the first time.
How can I get the following code to work with each individual record in my
subform?
It works but it effects check boxes in all records.
Thanks in advance
Alvin
------------Start My Code---------------
If Me.Accepted = -1 Then
Me.Rejected.Enabled = False
Me.Repair.Enabled = False
Me.RepairComplete.Enabled = False
Else
Me.Rejected.Enabled = True
Me.Repair.Enabled = True
Me.RepairComplete.Enabled = True

End If
-------------End My Code--------------------
_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
Thanks for the reply
I can't get conditional formating to enable or disable my other check boxes
and I tried the code you have and it still effects all record sets. Hmmm, lol
I'm lost
 
since you don't say *where* you're running the code, i'm assuming that
you're running it on the Accepted checkbox's AfterUpdate event. that's
correct as far as it goes, but you also need to run the same code on the
form's Current event. that way the correct property values will be assigned
as you move from record to record in the form.

hth
 
Alvin,

Am I right in assuming your subform is a continuous form? If so, then you
won't be able to do it satisfactorily, because changing the Enabled property
of one checkbox will affect all of them on the same continuous form.

But if it's not a continuous form, place the following code in the subform's
Current event:
Me.Rejected.Enabled = Not Me.Accepted
Me.Repair.Enabled = Not Me.Accepted
Me.RepairComplete.Enabled = Not Me.Accepted

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
I'm sorry Alvin. I put a test together and MS in their infinate wisdom has
elected not to include Conditional formatting for CheckBoxes. If they were
TextBoxes it would have worked for a continuous form. I'm sorry to send you on
a wild goose chase. Tina's and Graham's posts are correct but you will probably
be disappointed if you have a Continuous form as I suspect.

Thanks for the reply
I can't get conditional formating to enable or disable my other check boxes
and I tried the code you have and it still effects all record sets. Hmmm, lol
I'm lost
_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
Alvin,

To the best of my knowledge, there is no way to do it.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------
 
Back
Top