|
-
Mar 22nd, 2004, 02:28 AM
#1
Thread Starter
New Member
If statement problem
ok heres the code
Code:
If Split(sdata, "*/*")(0) = "handle" Then
'Checks if user needs permission to view!
If preference.Check16.Value = 1 Then
Dim Form As Form
Dim winsockindex1 As String
Dim requestpermission As Form
Set requestpermission = New requestpermission
requestpermission.Tag = "camrequest" & Split(sdata, "*/*")(1)
winsockindex1 = camview(Index).Index
'sets the varables to what is needed
For Each Form In Forms
If Form.Tag = "camrequest" & Split(sdata, "*/*")(1) Then Text1.Text = winsockindex1
Next
End If
For Each Form In Forms
If Form.Tag = "camrequest" & Split(sdata, "*/*")(1) Then Label1.Caption = Split(sdata, "*/*")(1) & " is asking you to view your webcam would you like to grant this request?"
Next
End If
Exit Sub
End If
ok I need the first if to stay open but the ones if form.tag i want to close them
and the "If preference.Check16.Value = 1 Then " i also want closed And the problem is im gettin an end if error.
the first if goes onto other ifs.
Does anybody know if im puttin the end if's in the wrong place or what?
Thanks!
-
Mar 22nd, 2004, 02:57 AM
#2
You have one to many End Ifs. Indenting your code would find these errors easily. If statements written completely on one line do not require an End If.
VB Code:
If Split(sdata, "*/*")(0) = "handle" Then
'Checks if user needs permission to view!
If preference.Check16.Value = 1 Then
Dim Form As Form
Dim winsockindex1 As String
Dim requestpermission As Form
Set requestpermission = New requestpermission
requestpermission.Tag = "camrequest" & Split(sdata, "*/*")(1)
winsockindex1 = camview(Index).Index
'sets the varables to what is needed
For Each Form In Forms
If Form.Tag = "camrequest" & Split(sdata, "*/*")(1) Then Text1.Text = winsockindex1
Next
End If 'for If preference.check16.value
For Each Form In Forms
If Form.Tag = "camrequest" & Split(sdata, "*/*")(1) Then Label1.Caption = Split(sdata, "*/*")(1) & " is asking you to view your webcam would you like to grant this request?"
Next
End If 'for If Split...
Exit Sub
End If 'Extra End If
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
|