Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Identifying a control name 1

Status
Not open for further replies.

dhanus

Programmer
Jun 17, 2003
28
MY
In the code below, how do I identify the name of the current control in the loop ?

There are a couple of fields in the form that can be left blank. I would like to check if the blank controls are these fields before popping the message.



For Each ctl In frm.Controls

If ctl.ControlType = acTextBox Or ctl.ControlType = acComboBox Then

If IsNull(ctl) Then


MsgBox "Please complete form !", vbInformation
Exit For
Exit Sub

End If

End If
 
Hi Ken

Thank-you for your help.

How can I refer to the ctl.name, i.e. I would like to set focus to that blank control ?

Docmd.GoToControl "how do I reference this?"

Best Regards
Dhanus





 
It's ok, Ken. I found the answer :

ctl.SetFocus


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top