Selecting related records in a combo box

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
 
D

dawn

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