Dynamically build textboxes

siCIVIC1986

Registered User.
Local time
Today, 18:10
Joined
Feb 22, 2010
Messages
12
Hi All

I am relatively new to forms and Access but I know a few things about VB so I am sure this isnt too difficult a task.

I have a form in access currently being populated by people with job information and the request for a cell breakdown has been made, What I want to do is based on a combo box that will be populated with values 1-99 for example I want to be able to output on my form the amount of information for the requested amount of cells so:

ComboBox = 2

Form would look like:

Cell1 - Input box linked to table
Cell1 Data - Input box linked to table
Cell1 Artwork - Input box linked to table

Cell2 - Input box linked to table
Cell2 Data - Input box linked to table
Cell2 Artwork - Input box linked to table

and so on...

is this a possibility? How does this link to the table? would I have to have fields in the table allready or can they be dynamically added?

Many Thanks in advance.

Si
 
if you have different amounts of tb's that need to be visible on the form based on a select, then the best thing to do would be to put the max num of tb's on your form that you would ever need, name them consistently with a number in the name so you can loop them, then loop it on the after update event of the select based on how ever much info you need.


example:
PHP:
open table's recordset here

docmd.findrecord "[field] = '" & me.combobox & "'"

for each field in table
   populate lowest numbered texbox here
      increase your integer here
next field
that is just one way

you NEVER want to create controls on forms from code. that is never necessary, and if it is, then the database is improperly structured.
 
Hi All

I am relatively new to forms and Access but I know a few things about VB so I am sure this isnt too difficult a task.

I have a form in access currently being populated by people with job information and the request for a cell breakdown has been made, What I want to do is based on a combo box that will be populated with values 1-99 for example I want to be able to output on my form the amount of information for the requested amount of cells so:

ComboBox = 2

Form would look like:

Cell1 - Input box linked to table
Cell1 Data - Input box linked to table
Cell1 Artwork - Input box linked to table

Cell2 - Input box linked to table
Cell2 Data - Input box linked to table
Cell2 Artwork - Input box linked to table

and so on...

is this a possibility? How does this link to the table? would I have to have fields in the table allready or can they be dynamically added?

Many Thanks in advance.

Si

I really think you dont want to do this - thinking in terms of cells shows spreadsheet thinking, which is not generally appropriate for a database

so, instead, can you clarify what you are trying to present, and what tables you have.

---------
if you really have to see a presentation in this way, then the easiest way is to get access to export (or fill) a spreadsheet with this layout - but that doesnt mean that that is how the data should be stored inside access.
 

Users who are viewing this thread

Back
Top Bottom