Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check Box Interaction

Status
Not open for further replies.

Ca1icoJack

IS-IT--Management
Nov 27, 2008
36
GB
I have three text boxes. If either or both of the first two are checked the third is activated. When both are deselected the third is deactivated, but the check in it is not removed. This makes it confusing for users.

The first two checkboxes have the following code. (With OutputData and OutputManualData reverse
___________________________________________________________
Private Sub CheckBox4_Click()

If OutputData <> "YES" Then
OutputData = "YES"
UserForm1.CheckBox2.Enabled = True
ElseIf OutputManualData = "NO" And OutputDAta = "YES" Then
OutputData = "NO"
UserForm1.CheckBox2.Enabled = False
CheckBox2.Checked = False
ElseIf OutputManualData = "YES" And OutputData = "YES" Then
OutputData = "NO"
End If

End Sub
___________________________________________________________

The third has:
___________________________________________________________
Private Sub CheckBox2_Click()

If TextBox10.Enabled = False Then
TextBox10.Enabled = True
TextBox11.Enabled = True
Else
TextBox10.Enabled = False
TextBox11.Enabled = False
End If

End Sub
___________________________________________________________

All I need is the tick in the third checkbox (2) to be removed when the first two are deselected. Any ideas how?

Thanks.
 
Something like (in the Click for combo 1 and 2):
Code:
If Not Check1 And Not Check2 Then Check5.Value = False
Hope this helps

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
That was incredibly simple, thanks very much. I didn't think value was used for check boxes.
 
Glad I could help [smile]

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
If I got you right, then you don't need any IFs for checkbox 3 at all.
This line should suffice:
Code:
CheckBox3.Checked=(CheckBox1.Checked OR CheckBox2.Checked)

:)

[navy]"We had to turn off that service to comply with the CDA Bill."[/navy]
- The Bastard Operator From Hell
 
MakeItSo,

My initial thought's were along the same lines but for the life of me, my version of access didn't have the .Checked property for checkboxes.

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
To be honest: neither does mine; I just copied it down from the OPs initial post. [blush]


[navy]"We had to turn off that service to comply with the CDA Bill."[/navy]
- The Bastard Operator From Hell
 
my version of access didn't have the .Checked property for checkboxes
The OP talked about UserForm (ie MSForm, not AccessForm) ...
 
Cheers PHV, as I saw no reference to userform's I incorrectly assumed it was a different version of Access [blush]

Ah well, we got it solved anyway [wink]

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top