PC Review


Reply
Thread Tools Rate Thread

Clearing trext box values

 
 
Risky Dave
Guest
Posts: n/a
 
      10th Jul 2009
Hi,

is there a way to clear all the etxtboxes in a form (something like
fmTest.AllTextBoxes.Clear) rather than having to list them individually?

TIA

Dave
 
Reply With Quote
 
 
 
 
ryguy7272
Guest
Posts: n/a
 
      10th Jul 2009
There's always a way...

Private Sub cmdNewPT_Click()
Dim C As MSForms.Control
For Each C In Me.Controls
If TypeOf C Is MSForms.TextBox Then
C.Text = ""
End If
Next C
End Sub

HTH,
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Risky Dave" wrote:

> Hi,
>
> is there a way to clear all the etxtboxes in a form (something like
> fmTest.AllTextBoxes.Clear) rather than having to list them individually?
>
> TIA
>
> Dave

 
Reply With Quote
 
Rick Rothstein
Guest
Posts: n/a
 
      10th Jul 2009
Assuming fmTest is a UserForm, give this code a try...

Dim C As Object
For Each C In Me.Controls
If TypeName(C) = "TextBox" Then C.Text = ""
Next

--
Rick (MVP - Excel)


"Risky Dave" <(E-Mail Removed)> wrote in message
news:49F95ABB-8B1C-404E-B7FA-(E-Mail Removed)...
> Hi,
>
> is there a way to clear all the etxtboxes in a form (something like
> fmTest.AllTextBoxes.Clear) rather than having to list them individually?
>
> TIA
>
> Dave


 
Reply With Quote
 
Risky Dave
Guest
Posts: n/a
 
      10th Jul 2009
Both,

Many thanks

"Risky Dave" wrote:

> Hi,
>
> is there a way to clear all the etxtboxes in a form (something like
> fmTest.AllTextBoxes.Clear) rather than having to list them individually?
>
> TIA
>
> Dave

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clearing Values of Variables =?Utf-8?B?QW5uZQ==?= Microsoft Access VBA Modules 1 11th Aug 2005 04:12 PM
update trext field based on check box entry =?Utf-8?B?RWxhaW5l?= Microsoft Access Form Coding 3 6th Dec 2004 11:47 PM
Clearing values Leszek Gruszka Microsoft VB .NET 2 20th Sep 2004 12:07 PM
Clearing Values in a form Haji Microsoft Access Forms 2 9th Jul 2004 10:49 PM
clearing values from a combo box dh Microsoft Outlook VBA Programming 3 25th Mar 2004 01:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:10 PM.