Auto multiple entry text fields

C

cosmonick

I'm trying to understand an older access database that I have to work on and
I see that there are text fields that once text is typed into them a new text
box displays below and if you type in that one another displays and so on.
It is very effective and I need to replicate on a different form but I have
no idea how to do that. I have a regular text box added to the form and it
can be filled with data but that data needs to have multiple entries. I need
it to work like all the other forms, so I can't use some kind of
combo/dropdown box. I have searched around and haven't seen anyone else
using something like this, even though it is all over in this database. If
anyone knows what I'm talking about and can help me recreate it I'd
appreciate it. Thanks!

-Nick
 
M

Mr. B

Nick,

The process is much the same if you are using combo boxes or text boxes.
Have your first control's "visible" property set to Yes (default) and any
additional controls set to Visible = No.

Then in the AfterUpdate event of the first control use code lilke:

If not isnull(me.NameOfCtrlOne) then
Me.NameOfCtrlTwo).visible = true
EndIF

You also want to have the Tab Order of your form set correctly so that the
focus will automatically move to the next control.

In the case of using a Combo Box, you would also need to requery the next
control to display only records relivant to the selection made in the first
control.

This process can be repeated for as many controls as you need to use.
 
J

Jeanette Cunningham

Hi cosmonick,
that sounds like a form in continuous view or datasheet view.
Go to the form's property dialog, Format tab and look for Default View.
Change it from single form to either continuous or datasheet view.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
C

cosmonick

You were right about the continuous view. That was a common denominator I
had overlooked. My previous form (that I didn't make, but works) was in
continuous view but did not have a AfterUpdate event. I believe the
continuous view was what I was looking for, but after I changed it nothing
happened. I have a form with several text boxes but only 1 of them do I need
to be continuous. Is that possible? I have a main form with a subform for
all these text boxes. Any more help would be much appreciated again, Thanks!

-Nick
 
J

Jeanette Cunningham

Nick,
on a continuous form, every control in the form's detail section is repeated
for each record.
There is no way to change that behavior.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
C

cosmonick

I must be missing something then. I have a main form basically just for
navigation and then a subform in it that holds all the text fields. I have 2
columns of text fields with each column having 10 rows. I have made this
subform continuous but none of the boxes allow for multiple entries. My form
that I'm trying to replicate was only 1 row with many columns, could this be
my problem now? Is there a way the form should be arranged that affects the
multiple entries? Either way I don't think it would help because I don't
want the whole form to be multiple entries just 3 of the fields. Should I
have a subform in my subform just for those fields? Is there a good way to
display it so it doesn't look like I have all these subforms? I will do some
more research myself but I figured I'd post these questions if someone has
the answer. Thanks,

-Nick
 
J

John W. Vinson

I must be missing something then. I have a main form basically just for
navigation and then a subform in it that holds all the text fields. I have 2
columns of text fields with each column having 10 rows. I have made this
subform continuous but none of the boxes allow for multiple entries. My form
that I'm trying to replicate was only 1 row with many columns, could this be
my problem now? Is there a way the form should be arranged that affects the
multiple entries? Either way I don't think it would help because I don't
want the whole form to be multiple entries just 3 of the fields. Should I
have a subform in my subform just for those fields? Is there a good way to
display it so it doesn't look like I have all these subforms? I will do some
more research myself but I figured I'd post these questions if someone has
the answer. Thanks,

-Nick

I think you need to take a step back.

You appear to be starting with and concentrating on Forms. Forms *do not store
data*, and controls on forms are *not fields*.

A form is just a window, a tool to manage data. The data is stored in Tables,
and only in Tables! You should - must! - have your table design correct before
you even start putting your first form together.

What are your Tables? What is each table's Primary Key? How are the tables
related? What Entities do these tables represent?

If any of the questions in the previous paragraph don't make sense... you'll
need to study about Normalization. See:

Jeff Conrad's resources page:
http://www.accessmvp.com/JConrad/accessjunkie/resources.html

The Access Web resources page:
http://www.mvps.org/access/resources/index.html

A free tutorial written by Crystal (MS Access MVP):
http://allenbrowne.com/casu-22.html

A video how-to series by Crystal:
http://www.YouTube.com/user/LearnAccessByCrystal

MVP Allen Browne's tutorials:
http://allenbrowne.com/links.html#Tutorials
 
C

cosmonick

Thanks for the links to tutorials. I have my table structure correct I'm
just trying to get the controls on the form do what I want. All my tables
have primary keys, they all have relationships between them...I'm not stuck
on that. I'm trying to get a continuous form working. Now that I know what
it's called I'm having much better luck finding the correct info via Google.
Sorry for not using the correct verbage when phrasing my question, I do
understand how databases work, just I'm used to mysql not ms access. Thanks
for the help,

-Nick
 
J

Jeanette Cunningham

Now that I know you are used to a different database system, I remember
helping someone with a similar problem some time ago.
It's a bit difficult to explain.
Access has a fabulous feature with subforms because you just put one line or
row of controls and access looks after the rest.
The other person I helped was used to a system where you had to put your own
rows of text boxes for a subform and write code to edit each one separately.
It took a lot of answers to finally see the problem was just that he was
used to a system that had no subforms that automatically look after every
row of data in a subform.
So you don't need to put rows and rows of text boxes on your subform.
You put only one row and if there are 20 records for your subform related to
the main form, access will automatically show the 20 rows. You put one row
of controls on the subform and access automatically will show the 20 rows or
however many rows are needed each time you open or filter the subform.
If this doesn't make sense, go to Rogers Access Library and download some
sample databases and also download the microsoft sample database called
Northwind and you will see how a subform works.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 

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