If I have several text boxes on a form, ie. txtBox1, txtBox2, txtBox3,
etc., how can I refer to each in a loop. I want to do something
similar to this:
Dim i as Integer
for i = 0 to 2
(txtBox & cstr(i)) = something
next
The above does not work. Can I accomplish this via other means?
Thanks. 3 2324
On 14 May 2006 15:27:48 -0700, Vincent wrote: If I have several text boxes on a form, ie. txtBox1, txtBox2, txtBox3, etc., how can I refer to each in a loop. I want to do something similar to this:
Dim i as Integer
for i = 0 to 2 (txtBox & cstr(i)) = something next
The above does not work. Can I accomplish this via other means? Thanks.
For i = 0 to 2
Me("txtBox" & i) = Something
Next i
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Vincent wrote: If I have several text boxes on a form, ie. txtBox1, txtBox2, txtBox3, etc., how can I refer to each in a loop. I want to do something similar to this:
Dim i as Integer
for i = 0 to 2 (txtBox & cstr(i)) = something next
The above does not work. Can I accomplish this via other means? Thanks.
Dim i as Integer
for i = 0 to 2
Me.Controls(txtBox & cstr(i)) = something
next
--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Rick Brandt wrote: Vincent wrote: If I have several text boxes on a form, ie. txtBox1, txtBox2, txtBox3, etc., how can I refer to each in a loop. I want to do something similar to this:
Dim i as Integer
for i = 0 to 2 (txtBox & cstr(i)) = something next
The above does not work. Can I accomplish this via other means? Thanks.
Dim i as Integer
for i = 0 to 2 Me.Controls(txtBox & cstr(i)) = something next
As Fred's post indicates the txtBox above needs to be quoted.
for i = 0 to 2
Me.Controls("txtBox" & cstr(i)) = something
next
--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: octagon |
last post by:
Hi, I have a form with various types of control such as txtbox, combo box,
listbox, subform and check box
I am trying hard to write a code for a check box after check the box
all the control in...
|
by: Lyn |
last post by:
Hi,
I am working on a genealogy form. The only table (so far) lists everybody
in the family, one record per person. Each record has an autonum ID.
The parent form (frmMainForm) displays the...
|
by: Joshua Ammann |
last post by:
Hi,
(Using Access 2000)
I have two tables, similar to Customers and Orders. (Not an exact
parallel, but works for this example.)
On a form showing customer data, there is a tab control. One...
|
by: 23s |
last post by:
Is there any way I can send a vertical value to a form's scroll position?
I have a full-screen form that, at launch, contains an empty tab sheet.
At run time, the user can dynamically append a...
|
by: mohit.akl |
last post by:
Hey guys & gals
I am havng trouble modifying the control box. I want to make the
maximise button invisible and have minimisise button instead of it.
Like this _ X (not like _ o X )
How...
|
by: inpuarg |
last post by:
I have a windows form, there are button , textbox label etc. controls
on it. and i can programmatically get each of their names. and i also
have a printPreviewDialog on a form.
I cannot get it...
|
by: masterej |
last post by:
Developers,
Is there any way to disable all checkboxes on a form? I have a form
with 160 checkboxes and I want to be able to disable all of them. Is
there a way I can do something like this:
...
|
by: Lysander |
last post by:
I need a way of finding the name of the active control on a form.
You can use currentdb() to refer to the current database
You can use Me to refer to the active form or report.
I need a...
|
by: EntryTeam |
last post by:
Hello every1.
I'm trying to get OpenGL functions working inside windows forms, using #develop (SharpDevelop), which is great.
I have this tutorial (in russian) and two files attached to it:...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
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
|
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...
| |