Collecting data via an input form

G

gkluther

I have a need to collect data from input forms. My problem is that on
these forms much of the data is the same from form to form. How can I
set the form up so that it will remain from input to input until
overwritten? Example: I am inputing surveys on classes. I want the
person doing the input to be able to type the class, instructor, time,
date of class, etc. one time and have it show up in the form for
subsequent surveys for that class.

Hope I have made myself clear. TIA (Thanks In Advance) for any
suggestions or help.
 
T

tina

what's your table structure - as in, tablename, fieldnames and data types,
primary key and foreign keys?

hth
 
T

T.G.

You could fix this with a little bit of visual basic code behind your form.

Every time the user writes something into a field in your form you can store
it in a variable.

Use the fields On Update event to store information. Double-click the form
field while you are in design mode. This opens properties for the field, go
to events and select on update event. Whenever the field is updated (on
update) you store the fields information in a variable.

Since your variable have to survive from one record to the next of your
form, you will have to declare it at the top or the visual basic module,
outside all of your procedures.

For instance, put this at the top of your visual basic module

Dim Instructor as string

In the fields On Update event you write something like this to put the value
of your field into your variable:

Instructor = Me.InstructorName (InstructorName is the name of your form
field)

Your variable Instructor will then store the value of the field


Then, when you go to the next record you write the contents of your variable
into the same field for the new record. You can use the forms On Current
event or After Insert event to do this. Double click on the forms upper left
corner in design mode to see the forms properties. Select for instance the
after insert event (after a new record is inserted)

In the after insert event procedure write the following:
Me.InstructorName = Instructor

You need to know how to use event procedures in Access

Regards

Tore
 
T

T.G.

I would like to add thet a need to repeat information from one record to the
next may be due to a weakness in the design of your tables. Normally one
woud try to keep the "repeated information" in a separate table.

If you do so, you can use a query as the source for your form, and the
repeated information will be taken care of automatically.

Regards

Tore
 

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