ComboBox

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
 
P

Pavel Romashkin

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
 
C

Crispy

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...
 
J

Jim Allensworth

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
 
P

Pavel Romashkin

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
 

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