|
-
Jun 8th, 2012, 01:06 AM
#1
Thread Starter
Addicted Member
[RESOLVED] For each Method
hi guys, i have 3 textbox like this :
ForEach Code:
Private Sub Command1_Click()
Dim a As Object
Dim T As TextBox
Set a = T
For Each a In Form1
a.Text = "TEST"
Next a
End Sub
but after the last text have been filled with "TEST" it show msgbox "Run Time error 13 Type Mismatch"
can u help me to solve this problem plz
-
Jun 8th, 2012, 01:09 AM
#2
Re: For each Method
That looks rather like VB6 code. Are you sure that you've posted to the correct forum?
-
Jun 8th, 2012, 01:19 AM
#3
Thread Starter
Addicted Member
Re: For each Method
oops.. sorry wrong forum..
-
Jun 8th, 2012, 03:03 AM
#4
Thread Starter
Addicted Member
-
Jun 8th, 2012, 04:18 AM
#5
-
Jun 8th, 2012, 05:01 AM
#6
Re: For each Method
try this too
Code:
Dim t As Control
For Each t In Me.Controls
If TypeOf t Is TextBox Then
t.Text = "TEST"
End If
Next
-
Jun 12th, 2012, 09:46 PM
#7
Thread Starter
Addicted Member
Re: For each Method
 Originally Posted by seenu_1st
try this too
Code:
Dim t As Control
For Each t In Me.Controls
If TypeOf t Is TextBox Then
t.Text = "TEST"
End If
Next
thx for solved my problem..
how to mark this thread as solved thread ???
-
Jun 12th, 2012, 09:53 PM
#8
Re: For each Method
click thread tools > Mark thread resolved, above the 1st post.
-
Jun 12th, 2012, 11:55 PM
#9
Thread Starter
Addicted Member
Re: For each Method
 Originally Posted by seenu_1st
click thread tools > Mark thread resolved, above the 1st post.
thx ,,,
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|