473,396 Members | 1,900 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,396 software developers and data experts.

Set up text boxes in VBA

Please suggest some links or sources which show how to set up form text
boxes in VBA.

Thank you so much.

Jun 13 '06 #1
9 2225
Bill (Unique as my name) wrote:
Please suggest some links or sources which show how to set up form text
boxes in VBA.

Thank you so much.

What don't you understand?

You click on the toolbox wizard and select the AB control. Then you
drop in onto the form and place it where you want.

Then you open up the property sheet and set the properties. You might
set the caption for the label, whether you want it sunken or flat, the
background/foreground colors under the Format Tab. If it is bound to a
table, you click the Data tab and define the field it is bound to in the
table. Under the Events tab you enter the code/macro. Under Other, you
give the control a name beside the one provided when created. For
example, if the text field will store the LastName, change it from Text0
or whatever to LastName.
Jun 14 '06 #2
salad <oi*@vinegar.com> wrote in
news:Wj****************@newsread3.news.pas.earthli nk.net:
Bill (Unique as my name) wrote:
Please suggest some links or sources which show how to set up
form text boxes in VBA.

Thank you so much.
What don't you understand?


It's not what the o.p. doesn't understand, it's what you didn't
understand, he specified about doing it in code.
You click on the toolbox wizard and select the AB control.
Then you drop in onto the form and place it where you want.

Then you open up the property sheet and set the properties.
You might set the caption for the label, whether you want it
sunken or flat, the background/foreground colors under the
Format Tab. If it is bound to a table, you click the Data tab
and define the field it is bound to in the table. Under the
Events tab you enter the code/macro. Under Other, you give
the control a name beside the one provided when created. For
example, if the text field will store the LastName, change it
from Text0 or whatever to LastName.

The steps to adding a textbox in code is that you need to open
the form in design mode, Dim a new control object, set its name,
top, left, height and width properties, control source and any
other properties you want set, then save and close the form,
then reopen it in normal mode. That's a lot of coding for
something that really only needs doing once.
--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Jun 14 '06 #3
Bob Quintal wrote:
salad <oi*@vinegar.com> wrote in
news:Wj****************@newsread3.news.pas.earthli nk.net:

Bill (Unique as my name) wrote:
Please suggest some links or sources which show how to set up
form text boxes in VBA.

Thank you so much.


What don't you understand?

It's not what the o.p. doesn't understand, it's what you didn't
understand, he specified about doing it in code.


Missed that one entirely. Thanks.

What the OP requested isn't your normal, everyday activity in coding.
Next, get him into ProcBodyLine and other module stuff so he can write
the code too.
Jun 14 '06 #4
* Bob Quintal:
salad <oi*@vinegar.com> wrote in
news:Wj****************@newsread3.news.pas.earthli nk.net:
Bill (Unique as my name) wrote:
Please suggest some links or sources which show how to set up
form text boxes in VBA.

Thank you so much.

The steps to adding a textbox in code is that you need to open
the form in design mode, Dim a new control object, set its name,
top, left, height and width properties, control source and any
other properties you want set, then save and close the form,
then reopen it in normal mode. That's a lot of coding for
something that really only needs doing once.


OK, I'll bite. Does "set up" mean to create text boxes, or simply alter
properties, such as visible, size and position?

--
Randy Harris
tech at promail dot com
I'm pretty sure I know everything that I can remember.
Jun 14 '06 #5
Bob Quintal <rq******@sPAmpatico.ca> wrote in
news:Xn**********************@66.150.105.47:
salad <oi*@vinegar.com> wrote in
news:Wj****************@newsread3.news.pas.earthli nk.net:
Bill (Unique as my name) wrote:
Please suggest some links or sources which show how to set up
form text boxes in VBA.

Thank you so much.

What don't you understand?


It's not what the o.p. doesn't understand, it's what you didn't
understand, he specified about doing it in code.


Why in the world would anyone do that?

I've been programming Access near fulltime since 1996 and never once
have I needed to do it.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Jun 14 '06 #6
> OK, I'll bite. Does "set up" mean to create text boxes, or simply alter
properties, such as visible, size and position?
Thanks for the intelligent positive response, Randy.

My interest is threefold: 1) I want to create textboxes, 2) to be able
to change the name of the text boxes, 3) to change their location on
the form.

I have a form with 420 unbound textboxes. When the form opens, a VBA
function runs a loop with three lengthy lines, each with its own
monstrous dlookup statement, which determines the values of the forms
textboxes. It took a while to set up the textboxes on the form and to
rename them so that the VBA function would work. The VBA part was a
breeze once somebody helped me with the code syntax.

Now I want to be brave and bold.

All I need is a single example that creates a textbox, gives it a name,
and sets some standard property values and the location. That would be
wonderful. Or if you have some handy links, that also would be a
blessing.

Thanks Randy.
Randy Harris wrote: * Bob Quintal:
salad <oi*@vinegar.com> wrote in
news:Wj****************@newsread3.news.pas.earthli nk.net:
Bill (Unique as my name) wrote:
Please suggest some links or sources which show how to set up
form text boxes in VBA.

Thank you so much.

The steps to adding a textbox in code is that you need to open
the form in design mode, Dim a new control object, set its name,
top, left, height and width properties, control source and any
other properties you want set, then save and close the form,
then reopen it in normal mode. That's a lot of coding for
something that really only needs doing once.


OK, I'll bite. Does "set up" mean to create text boxes, or simply alter
properties, such as visible, size and position?

--
Randy Harris
tech at promail dot com
I'm pretty sure I know everything that I can remember.


Jun 14 '06 #7
"David W. Fenton" <XX*******@dfenton.com.invalid> wrote in
news:Xn**********************************@127.0.0. 1:
Bob Quintal <rq******@sPAmpatico.ca> wrote in
news:Xn**********************@66.150.105.47:
salad <oi*@vinegar.com> wrote in
news:Wj****************@newsread3.news.pas.earthli nk.net:
Bill (Unique as my name) wrote:
Please suggest some links or sources which show how to set
up form text boxes in VBA.

Thank you so much.

What don't you understand?


It's not what the o.p. doesn't understand, it's what you
didn't understand, he specified about doing it in code.


Why in the world would anyone do that?

I've been programming Access near fulltime since 1996 and
never once have I needed to do it.

Neither have I. However see the O.P. response where he says he
has a form with 420 unbound controls.

I don't know what he's trying to acheive, but I wouldn't buy an
application from this guy.
--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Jun 14 '06 #8
"Bill (Unique as my name)" <br******@yahoo.com> wrote in
news:11*********************@h76g2000cwa.googlegro ups.com:
I have a form with 420 unbound textboxes. When the form opens, a
VBA function runs a loop with three lengthy lines, each with its
own monstrous dlookup statement, which determines the values of
the forms textboxes.


This sounds completely idiotic. Why in the *world* would you ever
contemplate such a thing?

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Jun 14 '06 #9
On 14 Jun 2006 11:26:29 -0700, "Bill (Unique as my name)" <br******@yahoo.com>
wrote:
OK, I'll bite. Does "set up" mean to create text boxes, or simply alter
properties, such as visible, size and position?


Thanks for the intelligent positive response, Randy.

My interest is threefold: 1) I want to create textboxes, 2) to be able
to change the name of the text boxes, 3) to change their location on
the form.

I have a form with 420 unbound textboxes. When the form opens, a VBA
function runs a loop with three lengthy lines, each with its own
monstrous dlookup statement, which determines the values of the forms
textboxes. It took a while to set up the textboxes on the form and to
rename them so that the VBA function would work. The VBA part was a
breeze once somebody helped me with the code syntax.

Now I want to be brave and bold.

All I need is a single example that creates a textbox, gives it a name,
and sets some standard property values and the location. That would be
wonderful. Or if you have some handy links, that also would be a
blessing.

Thanks Randy.


I can't see any logic in what you are trying to achieve, however the method
would fail within a short period of time.

There is a finite limit (768 rings a bell) of the number of controls that can be
created on a form during the form's lifetime. Every control (including lines,
boxes etc) created in the form adds to this count. The count remains even if the
controls are deleted. Once the maximum count is reached, no more controls can be
added to the form either manually or by code.

If you already have 420 controls on your form, it probably wont be too long
before you hit the ceiling.
Wayne Gillespie
Gosford NSW Australia
Jun 15 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dan | last post by:
Can anyone offer suggestions on how to do this or if it is possible? I have a form that uses a drop down box and 2 text fields. What I am trying to do is have the value of each text box set by...
7
by: Gertjan van Heijst | last post by:
Hi, I really hope someone can help me because I've already spend 2 days on this problem and I'm not getting anywhere. I think the problem is that I don't really understand how text boxes store...
2
by: John Kreps | last post by:
(acc 2002) I've got six unbound text boxes on a subform that has a white background. Each of those six boxes has an expression that when true, will change its background from white to another...
2
by: Gary | last post by:
Hello All, I have an editable data grid in my web form, this grid allows the user to add new records, edit existing records and also delete them. When a user adds a record the grid goes in to...
11
by: Edson Peacock | last post by:
I have a report with sub reports, one of the subreports have 12 text boxes that are 2" high and I want them all to grow if one goes to 3" high. If anyone has any suggestions they are very much...
6
by: BurntWithTime | last post by:
Hello everyone, Please can anyone tell me if it is possible for a VB.NET application to check a database and then create textboxes on a form that correspond to those records on the database? For...
4
by: Andrew Meador - ASCPA, MCSE, MCP+I, Network+, A+ | last post by:
I have created a report. This report needs to display records between two dates entered by the user. I put two text boxes on the report so I can enter the start and end date - I set them to use an...
6
by: =?Utf-8?B?Sm9obiBBdXN0aW4=?= | last post by:
I have an app that displays about 20 items of data in text boxes. Very occasionally I need to allow these to be used for data entry, but the bulk of the time they are solely for information. They...
6
by: noe1818 via AccessMonster.com | last post by:
Just a quick question about lines: Is it possible to connect a text box (e.g. txtbx1 to txtbx2 and txtbx2 to txtbx3) with lines where txtbx1,2,&3 move up or down according to their values? Like...
11
by: jwessner | last post by:
I have a form (Form1) which contains basic Project data and a subform listing the personnel assigned to the Project as a continuous form. Selecting a person on that project and clicking on a command...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.