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: 30
Default Find textboxes on a form ?

I Have a lot of Textboxes on my form and from an array I put numbers into these textboxes.
But it is only some of the textboxes that I want to put numbers in.

The names of my textboxes are TB1,TB2,TB3,TB4,TB5.........

My array consist of these numbers 1,2,3,4,5,6......

I find the correct textboxes using this metod -

For Each ctl In Me.Controls
If TypeName(ctl) = "TextBox" Then
If LCase(Left(ctl.Name, 2)) = "tb" Then
ctl.Value = ArrayMaterielPlacering(X, 3)
X = X + 1
End If
End If
Next ctl

What I want to do is to put the numbers fra the array into the textboxes -
1 into TB1, 2 into TB2, 3 into TB3, 4 into TB4.....

But the result came out this way

TB1 = 1, TB2 = 2, TB3 = 4, TB4 = 3, TB5 = 5, TB6 = 6 ....

TB3 and TB4 is swapping number ?

I found out that the metode - For Each ctl In Me.Controls -
found the textboxes on the form in this way - TB1,TB2,TB4,TB3,TB5,TB6.......

Hwo can I make the metod - For Each ctl In Me.Controls - find TB3 before TB4 ?

What I did was to change the place of TB4 and TB3 and then change the names, but is
it the correct way to do it ? Will there be ploblems later on ?



 
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
Where do I find the Data Form? Kowalik @ Gemini Excel Discussion (Misc queries) 2 February 27th 07 12:48 PM
Addressing specific textboxes on a form inquirer Excel Programming 4 August 31st 05 05:49 AM
Using Find & FindNext in a form BernzG[_13_] Excel Programming 3 August 19th 05 12:28 AM
TextBoxes on a Form Neil Excel Programming 4 June 4th 04 01:25 PM
Form Textboxes Pat[_11_] Excel Programming 1 February 3rd 04 09:42 PM


All times are GMT +1. The time now is 09:54 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"