|
-
Jun 11th, 2005, 05:09 AM
#1
Thread Starter
Junior Member
help! multiple if conditions?
ok... I want my program to check all "Checkboxes" - which it does... but I want it to check throughout the program (i used a timer) to see if ALL the checkboxes are checked. However, I am not too sure about how I would basically say:
If check1, check2 AND check3.value = true then
msgbox ....
end if...
please help
Last edited by twostars; Jun 11th, 2005 at 05:47 AM.
-
Jun 11th, 2005, 05:14 AM
#2
Thread Starter
Junior Member
Re: help! multiple if conditions?
actually, I will rephrase that....
I want it to somehow check if all 3 checkboxes are checked at the same time...
-
Jun 11th, 2005, 05:17 AM
#3
Thread Starter
Junior Member
Re: help! multiple if conditions?
-
Jun 11th, 2005, 05:20 AM
#4
Re: help! multiple if conditions?
 Originally Posted by twostars
ok... I want my program to check all "Checkboxes" - which it can do... but I want it to check throughout the program (i used a timer) to see if ALL the checkboxes are checked. However, I am not too sure about how I would basically say:
If check1, check2 AND check3.value = true then
msgbox ....
end if...
please help
VB Code:
Private Sub Command1_Click()
Dim chk As Control
For Each chk In Me.Controls
If TypeOf chk Is CheckBox Then
If chk.Value = vbUnchecked Then
MsgBox chk.Name & " is Unchecked."
Exit For
End If
End If
Next
End Sub
-
Jun 11th, 2005, 05:22 AM
#5
Thread Starter
Junior Member
Re: help! multiple if conditions?
? I want it to check by itself... with a timer
-
Jun 11th, 2005, 05:25 AM
#6
Thread Starter
Junior Member
Re: help! multiple if conditions?
I want it to ONLY make a messagebox appear when they are all checked... can you change that code to do it?
-
Jun 11th, 2005, 05:28 AM
#7
Re: help! multiple if conditions?
you could just put pradeep code into a timer event, or you could use the checkboxes own click event to check each time a box is check if all boxes are checked
pete
-
Jun 11th, 2005, 05:31 AM
#8
Thread Starter
Junior Member
Re: help! multiple if conditions?
how do you activate the click event?
-
Jun 11th, 2005, 05:37 AM
#9
Re: help! multiple if conditions?
Private Sub Check1_Click()
'put your code here
End Sub
edit: you will need to do for each checkbox
pete
-
Jun 11th, 2005, 05:41 AM
#10
Thread Starter
Junior Member
Re: help! multiple if conditions?
Private Sub Check1_Click()
'put your code here
End Sub
but what do I need inside them?! lol
-
Jun 11th, 2005, 05:46 AM
#11
Thread Starter
Junior Member
Re: help! multiple if conditions?
-
Jun 11th, 2005, 05:50 AM
#12
Frenzied Member
Re: help! multiple if conditions?
No need to bump the thread every 5 minutes.
VB Code:
Dim chk As Control
Dim AllChecked As Boolean
AllChecked = True
For Each chk In Me.Controls
If TypeOf chk Is CheckBox Then
chk.Value = vbUnchecked Then
AllChecked = False
Exit For
End If
End If
Next
If AllChecked = True Then MsgBox "All"
-
Jun 11th, 2005, 05:53 AM
#13
Thread Starter
Junior Member
Re: help! multiple if conditions?
it doesnt recognise or like the vbunchecked bit - the whole line
-
Jun 11th, 2005, 05:54 AM
#14
Re: help! multiple if conditions?
 Originally Posted by twostars
anybody????
VB Code:
Private Sub CheckNow()
Dim chk As Control
For Each chk In Me.Controls
If TypeOf chk Is CheckBox Then
If chk.Value = vbUnchecked Then
MsgBox chk.Name & " is Unchecked."
Exit For
End If
End If
Next
End Sub
Private Sub Check1_Click()
CheckNow
End Sub
Private Sub Check2_Click()
CheckNow
End Sub
Private Sub Check3_Click()
CheckNow
End Sub
Private Sub Check4_Click()
CheckNow
End Sub
.
.
.
Pradeep
-
Jun 11th, 2005, 05:57 AM
#15
Thread Starter
Junior Member
Re: help! multiple if conditions?
thx pradeep, although it still doesnt quite work... if check3 is unchecked; for some reason check2 UNCHECkS?
-
Jun 11th, 2005, 05:59 AM
#16
Thread Starter
Junior Member
Re: help! multiple if conditions?
dont worry bout it guys... I give up lol
-
Jun 11th, 2005, 06:00 AM
#17
Thread Starter
Junior Member
Re: help! multiple if conditions?
-
Jun 11th, 2005, 06:08 AM
#18
Re: help! multiple if conditions?
Please stop spamming. I don't have a clue why Pradeeps code doesn't work for you . Can you please explain clearly what effect you are after, and how it doesn't work, and then I will try to help you.
-
Jun 11th, 2005, 12:37 PM
#19
Banned
Re: help! multiple if conditions?
Are you looking for...
If Option1.Value = True And Option2.Value = True And Option3.Value = True Then
MsgBox "Meh"
End If
??
To enable a time its Timer1.Enabled = True
-
Jun 11th, 2005, 12:40 PM
#20
Re: help! multiple if conditions?
 Originally Posted by twostars
*sigh*
Instead of sighing, which does no one any good, why don't you post the code you are using? Thus far, all I've seen is code posted to help you, but I've not seen anything from you indicating what you are doing with the code.
-
Jun 14th, 2005, 05:08 AM
#21
Thread Starter
Junior Member
Re: help! multiple if conditions?
ThaRubby - that is EXACTLY what I mean! (is it possible)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|