create a text box with vba

checoturco

Registered User.
Local time
Yesterday, 16:25
Joined
Oct 17, 2005
Messages
76
hi all,

does anybody knows how to create a text box with vba code?

tks all
 
I know I'm going to be sorry I ask this, but why do you need to do this?
 
i wanna create the number of text box's with a for loop depending the number of records retrieved from a query to db. this number can be 10 or 40
 
Kind of like a continuous subform?
 
If you are talking about creating text boxes on the fley in an Access from each time the code is run then you are soon going to come to a grinding halt :(
There is a limit to the number of controls that can be created on a form(regardless of wether they are deleted inbetween or not!) cant recal the figure but it is not that high.
can you create the 40 possibles normally and then control visibility to show just what you need?

Peter
 
KenHigg Kind of like a continuous subform?

yes ken, but i don´t know the way to read the value that user insert on the one of the text box's.

bat wrote

There is a limit to the number of controls that can be created on a form(regardless of wether they are deleted inbetween or not!) cant recal the figure but it is not that high.
can you create the 40 possibles normally and then control visibility to show just what you need?


i know. i already done that and i received that message of the limit, that´s why i wanna create the text box's one fly.
the major problem here is not show the values(code,description) , but insert the values that the user fill for the corresponding code.

example:

code,description, value are the text box's

code | description | value
1111 asdf 2 ( inserted by user)
1253 ergs 3

the code and description are the values retrieved from the db with the query,
the value is filled by the user to be inserted in the DB


I already think in create a group of text box's, i.e. if i have 15 records, i create 10 text box's and insert the values into db and then show the others 5 text box's
 
looks like a subform is the way to go.
It will show blank fields for the value and will save them as soon as you change records.
Creating on the fly will not stop you hitting the field limit.
What are you doing with the values after they are added to the text boxes?
 
looks like a on going subform as all of us think here

you can create a two unbound text field in subform

You can serialize the FieldOne while FieildTwo you can leave it open for the users input

alternately

what you can do here is a play hide/show gimmick based on the criteria here by creating so call 40 text field on a form.

Its not a a very good idea to go about but as far as it helps you achieve ur goal - something is better then nothing.
 
What are you doing with the values after they are added to the text boxes?

i will insert then in two different tables with the docmd.runsql command, with the exmple above, the 2 value will be insert on the row with the 1111 code in one table as the 3 value will be inserted on the row witk code 1253, these values will be inserted in other table for the corresponding description.
 

Users who are viewing this thread

Back
Top Bottom