If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Conditional formatting
I have two option buttons in a group. If 'No Chg' is selected I'd like 6
other fields inactivated. I've read through a lot of the posts and tried several things, but I'm not getting it to work. It would seem that [Chgbackgroup]=0 would work, but it does not. Thanks. |
#2
|
|||
|
|||
Conditional formatting
When you have an option group, you reference it using the name of the frame
that defines the group. Access assigns a number to each item in the group, starting with 1. So if 'No Chg' is the label of the first item, your code would be something like this: Private Sub Form_Current() If Me.YourFrameName = 1 Then Me.ControlName1.Locked = True Me.ControlName1.Enabled = False Else Me.ControlName1.Locked = False Me.ControlName1.Enabled = True End If End Sub Private Sub YourFrameName_AfterUpdate() If Me.YourFrameName = 1 Then Me.ControlName1.Locked = True Me.ControlName1.Enabled = False Else Me.ControlName1.Locked = False Me.ControlName1.Enabled = True End If End Sub The example shows formatting one control (ControlName1) and you'd have to repeat this for the other 5 controls. "Deactivate" is not really a very clear term. I used Locked and Enable properties in the example above to render a textbox visible but unusable. If the controls are something other than textboxes, you'd have to use properties appropriate to the particular control. -- There's ALWAYS more than one way to skin a cat! Answers/posts based on Access 2000/2003 Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200906/1 |
Thread Tools | |
Display Modes | |
|
|