sharky12345
Well-known Member
- Joined
- Aug 5, 2010
- Messages
- 3,422
- Office Version
- 2016
- Platform
- Windows
I'm using this to set the focus to a field which is empty;
The issue I have is that all of the fields are on 4 different multipage pages, so I need a way to activate the relevant page once an empty field is found if anyone can help.
Code:
For Each ctl In Me.Controls
If TypeName(ctl) Like "Text*" Or TypeName(ctl) Like "Combo*" Then
If ctl.Value = "" Then
Call MsgBox("You have fields with mandatory data missing", vbCritical, "Missing data")
ctl.SetFocus
Exit Sub
End If
End If
Next ctl
The issue I have is that all of the fields are on 4 different multipage pages, so I need a way to activate the relevant page once an empty field is found if anyone can help.