automatically fill in data in new form

D

Denie

Because of the length of a survey instrument I am creating, I have had to
create several forms and tables with a one-to-one relationship. In the first
form, I assign an ID number automatically. At the end of the form, the user
clicks to continue to the next form. How do I carry the ID number to the next
form?
 
J

John W. Vinson

Because of the length of a survey instrument I am creating, I have had to
create several forms and tables with a one-to-one relationship. In the first
form, I assign an ID number automatically. At the end of the form, the user
clicks to continue to the next form. How do I carry the ID number to the next
form?

STOP.

You're making a very common mistake, using one field per question. That's good
spreadsheet design but it's WRONG for relational databases. You should instead
be using one *record* per question. See a good demo application at
Duane Hookum's "At Your Survey":
http://www.rogersaccesslibrary.com/Otherdownload.asp?SampleName='At Your Survey 2000'

If you want to do it the way you're doing (which is *wrong* and will make your
job vastly more difficult) you can use a Form with multiple subforms, using
the ID number as the master/child link field.
 
L

Larry Linson

John, I agree with your assessment.

However, if the original poster is bound and determined to create chaos,
confusion, and scads of work for himself in the future -- and thus insists
on following his original approach, he can open the next Form by using
DoCmd.OpenForm and pass the pertinent ID information in the "OpenArgs"
argument. That is well covered in VBA help for DoCmd.OpenForm and is a
property of the newly Opened Form that can be retrieved in its Open Event.

Larry Linson
Microsoft Office Access MVP
 
T

tina

i agree with both of you, John and Larry. but if i were going to do
something that crazy, i'd link the one-to-one tables in a single query, base
a form on the query, and use a tab control to provide enough real estate to
hold all the controls on the form. no need for multiple forms, or VBA code.
tina


Larry Linson said:
John, I agree with your assessment.

However, if the original poster is bound and determined to create chaos,
confusion, and scads of work for himself in the future -- and thus insists
on following his original approach, he can open the next Form by using
DoCmd.OpenForm and pass the pertinent ID information in the "OpenArgs"
argument. That is well covered in VBA help for DoCmd.OpenForm and is a
property of the newly Opened Form that can be retrieved in its Open Event.

Larry Linson
Microsoft Office Access MVP
 

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