Changing Controls

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

Guest

i ask if there is a way to change a control's property but in only a certain
record


in another words
i have a form which is tabular
there is a controal it's type is CheckBox
all i want is to make this chack box is disabled in a certain record depends
on a condition
and the rest if the check box instances in the other records are still enabled

thak for your time and cooperation?
 
Use the OnCurrent Event and use the enabled control property.

The OnCurrent is triggered everytime you change records. Use your condition
to control whether or not your chosen control is enabled or not.

Me.ControlName.Enabled = True 'User can access the control
Me.ControlName.Enabled = False 'User cannot access the control
 
Actually, Daniel's code will WORK, but it's not very pretty! It's true that
the check boxes on all the records will be enabled/disabled depending on the
condition of whichever record has focus. If RecordA's condition dictates that
the checkbox be enabled, all checkboxes will be enabled. But if you try to
click on the checkbox in RecordB, whose condition dictates that the checkbox
be disabled, you won't be able to, because RecordB now has focus, and all the
checkboxes are now disabled! Also, if you try to click on the checkbox of a
record where the checkbox should be enabled, but the previous record with
focus had the checkbox disabled, you'll have to click twice to get the box
checked! The first click gives focus to the record and the second click
actually checks the box. As I said, it will function, but it's not pretty!
The only real way to deal with formatting records in a continuous form is
thru Conditional Formatting, and unfortunately, Conditional Formatting is not
supported for Checkboxes.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top