Forms and Combo Boxes

  • Thread starter Thread starter Crispy
  • Start date Start date
C

Crispy

I have set up a music database with just over 1200 albums.

I have a combo box that is on a main viewing form which is itended as a
search tool for specific albums...because there are so many and I need to
find specific entries.

Problem is that if I click on a specific artist and album in the combo box,
the form then displays the record that is the FIRST one in that list for the
artist...

(For exapmle - If I click on Neil Young Zuma (That is 2 fields - Artist and
Album Title) in the combo box, then the form displays the first album of
Neil Young ie - Neil Young After The Goldrush!)

Anyone have any idea how when I click on a specific Artist and Album in the
combo box, that the database will show me the correct album in the Form?

I hope I have explained that properly!

Thanks in advance
 
Your tables should have a primary key to uniquely identify each record. The
combo box should have the primary key as the bound column. You don't have to
display the primary key in the combo box. Your row source could be something
like:
SELECT ID, Artist & "-" & AlbumTitle
FROM tblAlbums
ORDER BY Artist & "-" & AlbumTitle
 
Ooer!
I do not have a primary key!

The table that the data comes from has each artist and album as a eperate
record - So - for example, I have say 15 Neil Young ALbums and therefore 15
titles - Each one is a seperate record with all the track titles and other
details as seperate fields within the one record!

When I try to set a primary key, Access tells me I can't as the fields are
obviously not unique!

Any ideas how I might overcome this - I would hate to reconstruct
everything, as the table has over 1200 records in it..!

Thanks for any suggestions.
 
Do you have two fields that in combination are unique? Maybe
Artist & Album? There is such a thing as a 'composite key'
which says if the combination of the two are unique, this is
the key. Forms and reports will let you do a relationship
with a composite key.

Gary Miller
Sisters, OR
 
What I did was make the caption the same while's the real thing was for instance "Description1" and the caption says "Description". It worked for me that way.. :)
 
Back
Top