473,407 Members | 2,320 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Loop issues for textboxs with variables

21
I have 27 textboxes and am wishing to cycle through them using a do... loop.
this code doesn't work:

N = 1
Do
textbox(N).text = someStringArray(N-1)
N = N + 1
loop until N = 27

brings up a compile error: sub or function not defined

it doesn't like &, +, () and []. nothing works.

any suggestions?

cheers. Black Box
Oct 22 '06 #1
3 1259
MMcCarthy
14,534 Expert Mod 8TB
N = 1
Do until N = 27
control("textbox" & N).text = someStringArray(N-1)
N = N + 1
loop


I have 27 textboxes and am wishing to cycle through them using a do... loop.

this code doesn't work:

N = 1
Do
textbox(N).text = someStringArray(N-1)
N = N + 1
loop until N = 27

brings up a compile error: sub or function not defined

it doesn't like &, +, () and []. nothing works.

any suggestions?

cheers. Black Box
Oct 22 '06 #2
Killer42
8,435 Expert 8TB
N = 1
Do until N = 27
control("textbox" & N).text = someStringArray(N-1)
N = N + 1
loop
I'd just like to point out, the original code might work if the text boxes are a control array. Which I believe is generally considered more efficient anyway.
Oct 23 '06 #3
MMcCarthy
14,534 Expert Mod 8TB
You're probably right.



I'd just like to point out, the original code might work if the text boxes are a control array. Which I believe is generally considered more efficient anyway.
Oct 23 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

33
by: Arthur | last post by:
>>>a= >>> for p in a: print p 1 2 3 >>> p 3 My naive expectation was that p would be 'not defined' from outside
0
by: Sue Adams | last post by:
I actually have two issues/questions: I have an autonumber field in an access db table that I grab and later use to update a record in another table withing the same db. The code I use to get...
8
by: Drew | last post by:
I am building an application for keeping track of user permissions here at work. I have built the interfaces, and am now working on the processing page for inserting to the database. I am having...
7
by: Rajeev | last post by:
Hello, I'm using gcc 3.4.2 on a Xeon (P4) platform, all kinds of speed optimizations turned on. For the following loop R=(evaluate here); // float N=(evaluate here); // N min=1 max=100...
63
by: Aaron Ackerman | last post by:
What is the sytax for exiting a for loop in C#?
8
by: Microsoft | last post by:
I have the following loop the length contains somewhere around 1000+ items: For elemIndex = 0 To len - 1 elem = CType(doc.all.item(elemIndex), mshtml.IHTMLElement) If elem.tagName = "A" Then If...
2
by: kethireddy | last post by:
Hi .This is Aruna..Am working on ASP...Now am facing on a problem.. In the asp form i took 5 textboxs and one search button...when a write record name in a last textbox from database and click...
0
by: davidsavill | last post by:
Hi All, I am migrating a database from Firebird/Interbase to DB2 and have having issues with the stored procedures/functions. I have a number of functions that loop over a FOR loop, each pass...
0
by: ganesh22 | last post by:
Hi Iam using below code for creating dynamically textboxs bt the below code is creating only one vertical row for textboxs now i want 3 vertical rows can u give a code?? using...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.