Solved Run function if all three controls have data

@Edgar_ Your example works some what. I tried your example, and it checks every time and gives a message BUT when all the controls have data it runs the code BUT it runs it 3 times? How do I get it to only run one time?
Made the mistake of leaving the insert in the Else instruction. The insert should come after the validation of the array. It was doing this:
"For each item in the array, if its length is 0, exit. Oh, but if it's not 0, insert that sh*t" 🤷‍♂️

This should do it:
Code:
Private Sub CreateLabelList()
    Dim item As Variant
    For Each item In arr
        If Len(item) = 0 Then
            Debug.Print "nothing"
            Exit Sub
        End If
    Next item
    'Insert
    'Requery subform
End Sub

Sorry about that, should have tested.
 

Users who are viewing this thread

Back
Top Bottom