Related record

J

Jose Lopes

I’m not experienced with database design so I’m calling for some help.

I have two tables one called RECORDS and another called IMAGES

RECORDS
- REC_ID (PK)
- DATE_
- MEMO

IMAGES
- IMG_ID (PK)
- IMG_REC_ID (indexed, with a relationship to REC_ID)
- IMG (OLE type)
- IMG_MEMO

This will be used to record accident situations and there will be a few
photographs taken for each situation. I was able to create a form to input
the RECORD data. Then I used the assistant to create a button that will open
a new form (IMAGES FORM) where I want to introduce the images for that
REC_ID. The problem is, after in copy paste my images in the form, when I try
to close it, ACCESS will say that a record is necessary in the RECORDS table…
I thought that the necessary record was already created while inputting data
in the RECORDS form… what am I doing wrong?
 
J

Jeanette Cunningham

Jose Lopes,
the tables look to be set up correctly for the relationship to work.
The message could be appearing because the images form has not opened to the
correct rec_id from the records table.
Very often people use a main form with sub form setup - because if you do it
this way, access makes sure that you only add images for a record selected
from your records table.
You would use a form based on Records for the main form and the subform
based on the table images.

The wizard can set up the main form and sub from for you.
You can then make changes to suit if you wish.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
J

Jeff Boyce

Jose

A more common approach would be to embed that second form inside the first
as a "subform", and to use the subform control's parent and child properties
to link the two together. That way, any subform record you add will be
added within the context of the main form record you are starting with.

Good luck!

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
 

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