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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

is there a "doesexist " piece of code

Status
Not open for further replies.

Scoty

Programmer
Oct 25, 2000
278
US
Please help. Is there a way to see if a control exsists? IE. If text1 doesn't exist then check text2
Thanks in advance
Thanks
Scott
 
Look up the Controls Collection in MS Access help. You should be able to loop through that and test for the object name...

Hope this helps.


Terry M. Hoey
th3856@txmail.sbc.com

Ever notice that by the time that you realize that you ran a truncate script on the wrong instance, it is too late to stop it?
 
' Call SetTextBoxProperties procedure.
SetTextBoxProperties Me

Sub SetTextBoxProperties(frm As Form)
Dim ctl As Control

' Enumerate Controls collection.
For Each ctl In frm.Controls
' Check to see if control is text box.
If ctl.ControlType = acTextBox Then
' Set control properties.
With ctl
.SetFocus
.Enabled = True
.Height = 400
.SpecialEffect = 0
End With
End If
Next ctl
End Sub

DougP, MCP
dposton@universal1.com

Ask me how Bar-codes can help you be more productive.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top