i have tried everything and cannot get this to work. what i am looking to do is check all the items in the listview (subitem(1)) to see if a certain text string exists. if the string exists, then to not allow the closing of the app.
this is what i have, any idea?
i am getting argument not optional on highlighted.
VB Code:
Private Sub mnuFileMenuExit_Click() If lvwUserPunchedOut.ListItems[hl].Item[/hl] = "N/A - New Employee" Then MsgBox "You cannot close " & Me.Caption & vbNewLine & _ "because some users have never punched in or out yet.", _ vbExclamation, "New Users Present." Exit Sub Else Unload Me End If End Sub




Reply With Quote