Refering to fields on a subform

  • Thread starter Thread starter Shaun Allan
  • Start date Start date
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.
 
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
 
You need to set the Master and Child properties (The fields that link
them together) on the subform control on the main form
 
Back
Top