Access form

G

Guest

Ok

I have a table whihc has column name title and some survey question.

Now i want to create a form so that when i select Name ( I guess this will
be combo box) I dont know how to do that even where i can select name ? but
when i select name the person title auto populates and so does the relevant
answers to the questions

for example i choose John and the title should auto populate and question 1
should populate also and so on but if i pick adam then everything related to
adam populates.

Your help will be really appreciated


The table look like this



Name Title Question1 Question 2 Question 3

John Manager 1 2 3
 
A

Arvi Laanemets

Hi

You must have 2 tables, p.e. Persons and PersonQuestions.

Persons: PersonID, Name
PersonQuestions: QuestionID, PersonID, Question

(You may index fields Persons.PersonID and PersonQuestions.QuestionID let to
be Autonumeric - then PersonQuestion.PersonID must be Long Integer.)

Set 1:M relation betveen both tables through PersonID

Create a single form basing on Persons table. Leave PersonID hidden, Name
field visible and accessible. To add new persons, add a row, and enter the
name. You can add a combo box to navigate between persons - add a combo from
Toolbox, and give the table Persons as combo source, have both PersonID and
Name fields queried, link the combo to PersonID, and set the with fot first
column to 0. Place Name field (and navigation combo) at top of form.

Create a continous form based on PersonQuestions table. Set QuestionID and
PersonID fields hidden - so only Questin field will be visible.

Open Persons form, created previously. Drag newly created Questions form
from Project Manager into Persons form, and adjust it there, so it's wide
and high enough. When all was done properly, both forms must be related now.
You can check this in edit mode, activating the Propertyes Window, and
selecting the subform (On 1st click on subform, SubForm/SubReport object is
activated, on 2nd click the form Questions is activated). For SubForm
object, LinkChieldFields and LinkMasterFields both must contain PersonID
field - from Questions and Persons tables respectively.

When all was done in right way, whenever you select some person, all
questions for this person are displayed in subform. You can add questions to
any person which exist in table simply typing the new question onto new row
in subform. You can add new persons adding a row in Main form and typing the
new name in. To enchanche this design, you have to write some events, which
allow you to add questions for newly created persons, and to allow navigate
to such persons using combo - otherwise you must close the fole and reopen
to get changes available everywhere.
 

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