Multiple records in one form

updown

New member
Local time
Today, 20:29
Joined
Jan 9, 2010
Messages
5
I'm trying to create a very simple gallery, with comment system.

I have one table named Photo, which contains a field named MyImage defined as Attachemt.
I also have one table named Comments, with the field MyText defined as Text.


I want to show the results in a form, just like a typical image gallery:

First Record:
Photo 1
Comment 1 from Photo 1
Comment 2 from Photo 1
.
.
Comment n from Photo 1


Second Record:
Photo 2
Comment 1 from Photo 2
Comment 2 from Photo 2
.
.
Comment n from Photo 2

etc


I created a simple query from the Photo table, but if the photo has more than one comments, it gives me more than one results in the form too. For example, these are the results for 3 comments in one photo:

First Record:
Photo 1
Comment 1 from Photo 1

Second Record:
Photo 1
Comment 2 from Photo 1


Third Record:
Photo 1
Comment 3 from Photo 1



Can anyone help me? I'm newbie at Access and I don't know what I'm doing wrong. :confused:
 
Sounds like your "Comment" field is in the same table with "Photo".
To have the setup the way you want it, you will need the "Comments" in a separate table with a one to many relationship to the photo table. One photo can have many comments.
 
Yeap, I know. I've created it like this, but it doesn't seem to work.

capturehh.png
 
Yeap, I know. I've created it like this, but it doesn't seem to work.

capturehh.png
The link between Photos and Comments should be One to Many and not one to one
 
But it is one-to-many:

capturech.png



Should I change something from the options (Enforce Referencial Integrity, Join Type... etc)? :confused:
 
Change the join type and use a subform to enter many comments
 
Change the join type and use a subform to enter many comments
Which one of all the options should I use and why?

I have already used subforms but the results are shown in table form, while I want them in "classic" form layout (if you know what I mean). With a bit of tweaking, I can make it look less table-like, but aesthetically, it doesn't give the desirable result.
 
Which one of all the options should I use and why?

I have already used subforms but the results are shown in table form, while I want them in "classic" form layout (if you know what I mean). With a bit of tweaking, I can make it look less table-like, but aesthetically, it doesn't give the desirable result.
Use a continuous form as the subform and not the Wizard created datasheet
 

Users who are viewing this thread

Back
Top Bottom