Changing Controls

  • Thread starter Import Text File
  • Start date
I

Import Text File

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?
 
D

Daniel

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
 
I

Import Text File

Dear Daniel,

i've already tried this one before but this form is continous so it apllied
 
M

missinglinq via AccessMonster.com

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.
 
Top