Refering to fields on a subform

S

Shaun Allan

I've got a music database with fields for Artist and
Title, amongst others. They appear on a subform
frmMusicDetails placed on the main form frmMusicRecords.
I've got the Artist, using DISTINCT, to only list each
artist once (for example Westlife have 3 entries). My
problem is getting the Title field, once an artist has
been selected, to only list the albums by that artist, and
not every album title I've got. I can do this on a single
main form, but when it's done on the subform, it doesn't
work.
 
T

TC

Use of DISTINCT often indicates an error in the database design.

For artists & titles, you need something like this:

tblArtist
ArtistID (PK)
artist name, gender, date of birth, etc.

tblTitle
TitleID (PK)
ArtistID
Title, media, # of tracks, playing time, whatever.

Then, you would displsay tblArtist on the main form, and tblTitle on the
subform, linked together through the linkmasterfields and linkchildfields
properties of the subform control. Or you could generate the two forms using
the new-form wizard. No DISTINCTs required or desired!

HTH,
TC
 
G

Greg Kraushaar

You need to set the Master and Child properties (The fields that link
them together) on the subform control on the main form
 

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