Link to home
Start Free TrialLog in
Avatar of al4629740
al4629740Flag for United States of America

asked on

Run code for all LostFocus events under an array

I have the following code for a LostFocus event on my vb6 form.  As you can see it is on a textbox control named MR6Date(0)

I have an array of MR6Date(0) to MR6Date(19)

Is it possible to have this code run for all LostFocus events for this array?
Private Sub MR6Date_LostFocus(Index As Integer)

If Not MR6Date(0) = "" Then
    
    If IsDate(MR6Date(0)) = False Then
    MsgBox "Enter a Valid Date in the Correct Format", vbOKOnly, "Date"
    MR6CCM(0).Enabled = False
    MR6CSW(0).Enabled = False
    Exit Sub
    End If
    
Text15 = Format(MR6Date(0), "mm/dd/yyyy")


End If
End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial