Dynamically adding textboxes to forms

P

punter

Dear All...

I wish to open a form for data entry, with the form containing a text
box for each element in a table. As the table changes in size over
time (usually bigger, not smaller) I require the new additions to be
reflected in the form without me having to physically/manually add a
new textbox everytime my table is updated.

Many thanks in advance...

Regards,

punter1000
 
J

Jeff Boyce

It's called "maintenance", and you get to/have to do it when things change.

Are you quite certain you want to keep throwing new controls onto a form
without the opportunity to make decisions about their placement?

I'm curious why a well-normalized data structure would have a table that
would be adding fields over time. Is there a chance that the added fields
are "repeating fields", e.g., Month1, Month2, Month3,...?

If so, adding fields is how you'd handle the new data in Excel, a
spreadsheet, but not in Access, a relational database.

More info, please!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

jahoobob via AccessMonster.com

Are you saying that you add fields to your table and you want the fields to
be added to your form automatically? If so you will have to add the fields
to the form manually.
If you mean that as you add aditinal records to your form you want to see the
additional records on your form then if you have a Single Form view you can
scroll through each record. If you have a Continuous Form or Datasheet View
you will be able to see more records at one time on the form.
 
P

punter

Jeff ...

thanks for your reply. I apologise if I wasn't clear enough (I may
have even got my terminology wrong!).

I have a table with 5 fields and 10 records in it. This table forms
the basis of my data entry.

Lets say that the first field is called 'Items, at it contains
elements 'Item 1', 'Item 2' ... 'Item 10'. I would like these 10
elements shown as individual textboxes on the form when opening. If I
add 'Item 11' to the table at a later stage, then I would like to see
all 11 textboxes on the form.

I hope that is clearer.

Many Thanks again...

punter...
 
F

fredg

Dear All...

I wish to open a form for data entry, with the form containing a text
box for each element in a table. As the table changes in size over
time (usually bigger, not smaller) I require the new additions to be
reflected in the form without me having to physically/manually add a
new textbox everytime my table is updated.

Many thanks in advance...

Regards,

punter1000

This doesn't sound like a well designed database.
However, regardless of your reason for wishing to do this, there is a
lifetime maximum of 754 controls which can be included in a form
(deleted controls are still counted as part of the 754).

See Access help:
Specifications + Access Specifications + Forms and Reports

I'd suggest you re-think your database design.
 
P

punter

Jahoobob ...

I am adding records to the table, not fields. It will be only a small
record count ... see my reply to Jeff above...

As per your adding records suggestion .. do you advise I insert a
datasheet view rather than textboxes?

Regards,

punter...
 
P

punter

fredg ...

thanks ...

it is a very simple relationship database. Every month I enter data
based around 10 Schedule of Rate items (SORs). Rather than me entering
the SORs individually each month in a datasheet view situation, I
would like the SORs to appear automatically on a form so I can enter
the necessary data in the other fields. There will be a time in the
future where another SOR will need to be added to the table, so
therefore will need to be shown.

I figured if I could get one field up there, then I could work out how
to get the others showing.

Thanks again ...

punter
 
J

John W. Vinson

it is a very simple relationship database. Every month I enter data
based around 10 Schedule of Rate items (SORs). Rather than me entering
the SORs individually each month in a datasheet view situation, I
would like the SORs to appear automatically on a form so I can enter
the necessary data in the other fields. There will be a time in the
future where another SOR will need to be added to the table, so
therefore will need to be shown.

One way to do this is to use a continuous Subform based on a query. You'ld
need a ten-row table of SOR's, and a table with an arbitrary number of rows to
hold the monthly results (related one to many to some other table, of accounts
or the like).

You can create a query joining the ten-row table of SOR's to the results table
by a Left Outer Join - select the join line in the query and choose option 2
(show all rows in SORs and matching records in Results). Be sure to include
BOTH the primary key of SOR and the foreign key in the results table in your
query so that "row fixup" can copy the ID from the SOR table into the results
table.

Have controls on the form bound to the fields in the results table; when you
enter data, it will fill in the SOR item number and write the record to disk.

John W. Vinson [MVP]
 
P

punter

John...

Thanks very much for this, I really appreciate it. I'll start it
tonight!!

Regards,

punter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top