Record count incorrect when a record has multiple attachments

P

Petemeister2k

Hello,

At the bottom of the form where you it shows the record count and where
you can navigate the records, it is showing that I have 6 records, whereas
there are only 5 records in the table.

One of my records has 2 attachments - when I removed one of the attachments,
then the record count displayed the correct value. Also, when I click on
Next Record when on the record with 2 attachments, it redisplays the same
record and doesn't navigate to the next logical record.

Any way around this? I want to be able to capture multiple attachments
per record, but I can foresee user issues with this.

Thanks,

Pete
(e-mail address removed)
 
C

Clifford Bass

Hi Pete,

What is the Record Source of the form? I am guessing that it is a
query that links between your main table and a table that holds the list of
attachments. If so, you need to change your form's Record Source to show
just the main table's data. And then add a subform that uses the attachment
table as its source, allowing for multiple attachments for each main item.
If you are not familiar with subforms, do a search in the online help for
"subform". And I am off about what is going on, please post back with more
detail about your situation. Tables involved? Forms involved? Other
information?

Clifford Bass
 
P

Petemeister2k

The Record Source is a query against a single table (attachments are
contained in the same table).

Here's the query.

SELECT Contact.*, Contact.Attachment.FileData, Contact.Attachment.FileName,
Contact.Attachment.FileType
FROM Contact;

This is for a single form which doesn't have any subforms.

Thanks in advance,

Pete
 
C

Clifford Bass

Hi Pete,

Ah, I see. I was not remembering the Attachement data type. When you
do the query the way that you are doing it, it is going to perform exactly as
you described because you are telling it to display what is in essense data
from a parent table and from a child table. Whether a real child table or a
pseudo-child table does not really matter. There is a one-to-many
relationship being produced. I have not tested this, but is follows
essentially my original recommendation. Do a main form with the Contact
table as its source. Then do a subform with something like this for the for
the Record Source.

SELECT Contact.ContactID, Contact.Attachment.FileData,
Contact.Attachment.FileName, Contact.Attachment.FileType
FROM Contact;

On the subform display the FileName field. You may need the other
fields in hidden text boxes. I think it will allow for the addition of
additional attachments merely by adding a file name to the FileName field.
Again, I have not tested that.

Good Luck,

Clifford Bass
 

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