cssc1
asked on
How to keep the "Position>Set to Front" to stay in the from of the checkbox?
PROBLEM
The set position to front is not staying in the from.
DESCRIPTION
I am text box with using conditional formatting to cover checkboxes that are not checked. If the user clickes the textbox used to cover the checkbox, the position of the textbox goes to the back,
Please see attached
Format-Error.jpg
Set-Position.jpg
The set position to front is not staying in the from.
DESCRIPTION
I am text box with using conditional formatting to cover checkboxes that are not checked. If the user clickes the textbox used to cover the checkbox, the position of the textbox goes to the back,
Please see attached
Format-Error.jpg
Set-Position.jpg
I recommend that instead of using a textbox to cover the checkboxes you modify the .Visible property of the actual checkboxes and make them Visible/Invisible. If you just cover them they are still accessible and can be tabbed through (using the <Tab> key). When they are activated with the <Tab> key they can be checked/unchecked using the spacebar.
ASKER
The Text Box properties are already set to "Locked --> Yes, Enabled --> No" .
The property adjustment for "Visible or NonVisible" is one or the other. How would I work this out for visible if another check box (in the same table and form) is checked YES, to make the second check box become visible?
The property adjustment for "Visible or NonVisible" is one or the other. How would I work this out for visible if another check box (in the same table and form) is checked YES, to make the second check box become visible?
The easiest way to achieve this is to use the Event Procedure.
Open the form in the design view and select the checkbox that is supposed to control the visibility of the other checkboxes. Open its properties. Select the events tab. Click on the OnClick event and select the "Event Procedure". The VBA editor should come up. In the code type this:
Open the form in the design view and select the checkbox that is supposed to control the visibility of the other checkboxes. Open its properties. Select the events tab. Click on the OnClick event and select the "Event Procedure". The VBA editor should come up. In the code type this:
Private Sub Check0_Click()
[Check4].[Visible] = [Check0]
End Sub
This code assumes that the "master" checkbox is called Check0 and the "slave" checkbox is called Check4. You need to change the names of the controls in the code to match yours. If a check box controls visibility of more than one element add additional lines: [Check4].[Visible] = [Check0]
[Check5].[Visible] = [Check0]
[Check6].[Visible] = [Check0]
To make the controls behave in reverse use the Not operator: [Check4].[Visible] = Not [Check0]
[Check5].[Visible] = Not [Check0]
[Check6].[Visible] = Not [Check0]
ASKER
For some reason I am getting compile error. On the image attached I have what I tried.
Errors.jpg
Errors.jpg
ASKER
chaau,
I created a small test db to test the code just as explained. I still can't get the code to work. The test db has one table with three fields, two are check boxes and one is an ID field. I named the exactly as in the example.
Can you please get this example working so I can learn how to do it on other forms?
thank you very much
TESTDB.accdb
I created a small test db to test the code just as explained. I still can't get the code to work. The test db has one table with three fields, two are check boxes and one is an ID field. I named the exactly as in the example.
Can you please get this example working so I can learn how to do it on other forms?
thank you very much
TESTDB.accdb
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Perfect, thanks for ther help
Locked --> Yes
Enabled --> No