One-to-one relationship

E

Enid

I am importing a DB from Filemaker with info about students (names, address,
etc.). There is just one table and because it has been used for many years,
it cannot be changed. I have created another table for additional student
enrollment information. I have created a one-to-one relationship between the
two tables using an autonumber primary key in the student table and a number
primary key in the enrollment table. I have created two forms to add
information to the tables. All new students are added via the old student
form first. When I switch to the new student form, I cannot add the student
number to the primary number field because it is bound to the Autonumber ID
form. However, I can add new records directly into the table. Because other
people will be using these forms, I would like to be able to update the
number primary key by typing in the autonumber primary key. Is there any way
to do this?

Thanks.
 
J

Jeff Boyce

Enid

Is the "number primary key in the enrollment table" of type "Long"? That's
the only "number" type that matches an Autonumber.

--

Regards

Jeff Boyce
Microsoft Access MVP

Disclaimer: This author may have received products and services mentioned in
this post. Mention and/or description of a product or service herein does
not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
J

John W. Vinson

I am importing a DB from Filemaker with info about students (names, address,
etc.). There is just one table and because it has been used for many years,
it cannot be changed. I have created another table for additional student
enrollment information. I have created a one-to-one relationship between the
two tables using an autonumber primary key in the student table and a number
primary key in the enrollment table. I have created two forms to add
information to the tables. All new students are added via the old student
form first. When I switch to the new student form, I cannot add the student
number to the primary number field because it is bound to the Autonumber ID
form. However, I can add new records directly into the table. Because other
people will be using these forms, I would like to be able to update the
number primary key by typing in the autonumber primary key. Is there any way
to do this?

Thanks.

Simply make the additional-data form a Subform of the student form, using the
autonumber field as the Master Link Field and the foreign key as the Child
Link Field.

Or, you can include BOTH ID fields in the form's recordsource, basing the form
on a query including both tables; Access will fill in the foreign key value.
 

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