I think you should consider redefining your table, expecially as it appears
you have no primary key.
Another approach would be to have a field for the filename of the PDF file
and a marker indicating Report or Photo.
This would ensure that each record would have a filename and this could be
assigned as the primary key.
To relate the Report to the Photo you would need another field that would
be the foreign key reference to another record in the same table.
The table may look like this:
Table: PDF Files
Field: PDF Filename (Primary Key)
Field: PDF Filetype (Report or Photo) probably best as a Yes/No field
Field: PDF Filename Related (Foreign Key) Make this No Duplicates also
You should also define a Table Validation rule to ensure that PDF Filename
and PDF Filename Related cannot be the same. [PDF Filename]<>[PDF Filename
Related]
Create a 1 to 1 relationship between the PDF Filename and the PDF Filename
Related fields in the same table. You will need to add two copies of the
same table to the relationships window.
You will need to use the marker field to ensure that you recording or
viewing a particular type of PDF file, i.e. Report or Photo.
The current form you have will need to have 2 records one for the Report
and one for the Photo filename, the Report/Photo marker needs to be set to
Yes for one and No for the other.
--
Slainte
Craig Alexander Morrison
Seth said:
Jeff, I hope this explains it better:
I am developing a database to keep track of test reports.
All test reports are available as a hard copy.
Some of these test reports are available as PDF.
If a report is available as a PDF there could be two files Report and
Photo
attachment.
I can't set the fields as required, as there is not always a PDF report.
And
if there is a PDF report there is not always a photo attachment.
In my table I have two fields PdfReport and PdfPhotos.
The user enters the path and file name using an open file dialogue box.
I want to ensure that any file is only entered into the database only
once,
wether it is into PdfReport or PdfPhotos.
Thanks for your help,
Seth