LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Reset TextBox values on userform

VBA doesn't support control arrays, so the syntax TextBox1(i) is all wrong.

Try the following

Dim Ctrl As MSForms.Control
For Each Ctrl In frmOrderForm.Controls
If TypeOf Ctrl Is MSForms.Textbox Then
Ctrl.Text = vbNullString
End If
Next Ctrl


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)



"Trevor Williams" wrote in
message ...
I'm trying to reset all textboxes on a form to a zero string before the
form
initializes, but without any success - what am I doing wrong?

For i = 1 To 15
frmOrderForm.TextBox1(i).Text = ""
Next i

Thanks - Trevor



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reset userform Newbie Excel Programming 4 February 5th 07 04:11 AM
Keeping Textbox Values After Reopening Userform biodieselbenz Excel Programming 2 July 6th 05 05:28 PM
Userform Reset After Scrolling JoJo Excel Programming 0 July 2nd 04 05:26 AM
Adding up values of textbox in Userform Mark Excel Programming 3 April 25th 04 09:10 PM
UserForm TextBox to ActiveSheet TextBox over 256 characters Dan E[_2_] Excel Programming 1 July 28th 03 07:36 PM


All times are GMT +1. The time now is 06:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"