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!