Where am I going wrong? I want bool to pass to sub but I get a "by refrence type mismatch" error.Here's the code:


Public bool as boolean
Private Sub Option1_Click(index As Integer)

If index = 0 Then
Call Pass(bool)
If bool = True Then
frmbool.Show
End If
End If
If index = 1 Then
Call Pass(bool)
If bool = True Then
frmNew.Show
End If
End If
End Sub

Public Sub Pass(bool As Boolean)
If InputBox("Please Enter Your Password") = "password" Then
bool = True
Unload Me
Else
Exit Sub 'Form_Load
End If
End Sub