Easy way to have 10 question on seperate forms save to single tabl

P

pokdbz

I have 10 questions that need to be on seperate forms due to the text size of
the questions and answers. I need to know how to get all of the information
saved into one table under the Same SSN. These questions will be asked more
than once on different dates so there will be multiple entries of the same
SSN.
 
J

Joel

Can't you just have the users scroll down on a single form?
That way all the questions would be on one form.
 
P

pokdbz

Nope using a Touch screen monitor

Joel said:
Can't you just have the users scroll down on a single form?
That way all the questions would be on one form.
 
G

Graham R Seach

I suppose you could have a module-level variable to hold the SSN. You'll
need to set the DefaultValue of the Datestamp table field = Date().

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
J

Joel

You can link the forms together with a button usung the ssn as a link.

Code on click:

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "your-next-forms-name"

stLinkCriteria = "[SSN-field-name]=" & Me![Box-where-user-enters-there-ssn]
Docmd.OpenForm stDocName, , , stLinkCriteria

HTH
 
P

pokdbz

What if I make the question and answer not visible once then answer it and
then make the next question and answer visible will this work on the same
form?

Basicly will it save the data if it is hidden.
 
G

Graham R Seach

Yes, the data will be saved, even if hidden - as long as each control is
bound to a database table field.

Your suggestion of controlling visibility will work, provided the answers
for each person are stored in the same record, but you'll need code to
handle the visibility from one question to the next.

However, I would expect each question and answer to occupy a single record
each, rather than multiple fields within the same record. What I mean is,
you should have two tables; one for questions and one for answers:
tblQuestions
QuestionID (Autonumber - Primary Key)
QuestionText (Text)

tblAnswers
AnswerID (AutoNumber - Primary Key)
QuestionID (Long Integer)
PersonID (Long Integer)
AnswerText (Text)

One-to-many relationship between tblQuestions.QuestionID -->
tblAnswers.QuestionID.
One-to-many relationship between tblPeople.PersonID -->
tblAnswers.PersonID. tblPersonID would contain the person's SSN.

The above schema would be the ideal, but it would mean that your suggestion
of simply controlling visibility on the same form wouldn't work, because
each answer would be saved to a different record. To use this schema, you
would need to use a continuous form or several forms.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------
 
Top