Ok. np
Lets do this in stages.
So to use the code as it stands now, just validating the user (no group code yet), we would use something like:
Code:
Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
   Dim authenticated As Boolean = AuthenticateUser()
   If isAuthenticated Then
      'some code here to open app
      Me.Close()
   Else
      'code here to display incorrect login details
   End If
End Sub

Private Function AuthenticateUser() As Boolean
   Dim username As String = txtUsername.Text
   Dim password As String = txtPassword.Text
   Dim domain As String = 'this can be in a config file, hard coded (I wouldnt do that), or inputed from the UI

   Dim isAuthenticated As Boolean = ValidateActiveDirectoryLogin(username, password, domain)

   Return isAuthenticated
End Function
Hope this helps.

Woka