ComboBox

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

Crispy

I have a Combo box on a form that is supposed to find a particular
artist/album in a CD database.

With 1600 albums, I have some artists with quite a few albums.....When I
choose the artist and album in the combo box, the form that appears is just
the artist (ie, the first album in the artist list) in general and does not
go to the specific artist/album choice!

Any idea how I can get it to do to the specifc artist/album?

Thanks
 
You can have more than one column in the combo box. Make sure both
ArtistID and AlbumID are available in columns of the combo box, then
select the right record in the form.

Pavel
 
I do have both - So on the drop down, it shows the artist AND the
album.....Not just one or the other!

Any further ideas...?

Thanks in advance...
 
I have a Combo box on a form that is supposed to find a particular
artist/album in a CD database.

With 1600 albums, I have some artists with quite a few albums.....When I
choose the artist and album in the combo box, the form that appears is just
the artist (ie, the first album in the artist list) in general and does not
go to the specific artist/album choice!

Any idea how I can get it to do to the specifc artist/album?
What are you doing with the combo box? Opening another form or
locating a record on the current form?

If you are opening another form then supply the Where argument to to
the OpenForm method. Something like...

DoCmd.OpenForm "frmMyForm",,,"Artist=" & Chr(34) & _
Me.cboAlbum.Column(0) & Chr(34) & " AND Album=" & Chr(34) &
Me.cboAlbum.Column(1) & Chr(34)

If you are locating a record on the current form use the form's
RecordsetClone. Something like...

Dim strWhere As String

strWhere = "Artist=" & Chr(34) & Me.cboAlbum.Column(0) _
& Chr(34) & " AND Album=" & Chr(34) _
& Me.cboAlbum.Column(1) & Chr(34)

Me.RecordsetClone.FindFirst strWhere
Me.Bookmark = Me.RecordsetClone.Bookmark


Of course you will need to change object names to what yours are.

- Jim
 
Use both IDs in the WHERE ArtistID = "xxx" AND AlbumID = "yyy" clause
of the query that the form is based on to limit the records to those
containing BOTH ids. You can pass the criteria (without the word WHERE)
to the form being opened in DoCmd.OpenForm method.

Pavel
 
Back
Top