Selecting related records in a combo box

  • Thread starter Thread starter John Milward
  • Start date Start date
J

John Milward

Hi

I have a datbase with an address table and a contacts table, where the
contacts are related to the address by an ID field.
On a form that is showing address records I need a combo box which just has
the contacts that relate to that current address. This seems a simple thing
but I cant get it to happen. I either get all the contacts or nothing.
Can anyone point me in the right direction please

TIA

John
 
you could put an onchange event that sets the rowsource of
your combo box to the selection.

Something like this


Private Sub SourceList_Change()
Me.AdressList.RowSource = "select * from address where
source_id = '" & Me.SourceList.Value & "'"
End Sub

each time you change your sourcelist the addresslist will
be updated with new values.
 

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

Back
Top