morsy_soliman
New member
- Local time
- Today, 14:56
- Joined
- Apr 26, 2017
- Messages
- 5
Hello All,
I am using the VBA code below in a Public Function(ByRef frm As Form) to loop through the control of any form to look for any control tagged by "R" is empty.
The code is working well but it goes alphabetically based on the name of the control.
I am looking if somebody kindly help me to loop through the control using their tab index?
"I am using the VBA code" Please use code tags
I am using the VBA code below in a Public Function(ByRef frm As Form) to loop through the control of any form to look for any control tagged by "R" is empty.
The code is working well but it goes alphabetically based on the name of the control.
I am looking if somebody kindly help me to loop through the control using their tab index?
"I am using the VBA code" Please use code tags
Code:
Dim ctl As Control
Dim CurrentForm As Form
Set CurrentForm = Screen.ActiveForm
Set ctl = CurrentForm.ActiveControl
For Each ctl In frm.Controls
If Left(Right(ctl.Tag, 4), 1) = "R" Then
If IsNull(ctl.value) = True Then
ctl.SetFocus
Select Case TypeName(ctl)
Case "TextBox"
Case "ComboBox"
End Select
End If
End If
Next ctl
Last edited by a moderator: