If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > type of control is textbox

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-16-06, 12:37
MikeroSoft MikeroSoft is offline
Registered User
 
Join Date: Apr 2006
Posts: 47
type of control is textbox

i would like to iterate my controls and if its a textbox check a value

i have :

Dim txt As Control

For Each txt In Me.Controls
If txt Is TextBox Then <-- wrong, how can i check?

If txt.Tag = "r" Then

If Len(Trim(txt.Text)) = 0 Then
txt.Text = "Required Field"
txt.Interior.Color = vbYellow
bRequired = False
End If
End If
End If
Next
Reply With Quote
  #2 (permalink)  
Old 06-16-06, 13:55
norie norie is offline
Registered User
 
Join Date: Mar 2006
Posts: 163
There are 2 ways.
Code:
 If TypeOf txt Is MSForms.TextBox Then
Code:
If TypeName(txt) ="TextBox" Then
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On