You can leave the
in the Form_Load and use those changes in your Comand1_Click:Code:Private Sub Form_Load() ValidStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" End Sub
Code:Private Sub Command1_Click() Dim i As Integer Dim Check As String For i = 1 To Len (ValidStr) Check = Mid (ValidStr, i,1) If InStr(ValidStr, Check) > 0 Then MsgBox "Hello" Exit Sub End If Next i End Sub




Reply With Quote