THis won't work: Wrong Event
Private Sub MultiPage1_Change()
dim contr as object
For Each contr In UserForm1.Controls
If TypeName(contr) = "ComboBox" Then
If contr.ListIndex = -1 Then
MsgBox " you have incomplete answers"
Exit Sub
End If
End If
Next
End Sub
Try this
Option Explicit
Private Sub CommandButtonX_Click()
'Replace CommandButtonX with your button name.
Dim Pg As Object, Ctrl As Object
For Each Pg In MultiPage1.Pages
For Each Ctrl In Pg.Controls
If TypeName(Ctrl) = "ComboBox" Then
If Ctrl.ListIndex = -1 Then
MsgBox "You have incomplete answers on Page " & Pg.Caption
Pg.SetFocus 'Redundant
Ctrl.SetFocus
Exit Sub
End If
End If
Next
Next
End Sub
Use the Go Advanced button to upload attachments