PDA

Click to See Complete Forum and Search --> : ADO & linked Datacombo probems


JonnyCab
May 31st, 2000, 12:06 PM
I have a Datacombo which is filled with items from a ADO data source/connection/ SQL command.

I what to have a text box which displays a corresponding field. ie ... from the same record from which the item selected in the text box originates.

I want to text in the text box to change to corresponding field value when the user selects a different item from the datacombo box.

Any help would be greatful... Have a feeling a need a data control but am unsure how datacombo and text box should be connected to this

Cheers

Jonny

Edneeis
May 31st, 2000, 05:23 PM
Private Sub DataCombo1_Click(Area as integer)
'Makes sure the click is in the dropdown box and there is something selected
If Area=2 And DataCombo1.text<>"" then
'Assuming the name of the ADO object is ADO and the field used to Identify a record is UsrName
ADO.Filter="UsrName='" & DataCombo1.text & "'"
'This filters through the recordset and pulls out any records that match the criteria in the filter
'This will work for search for a string if it is a number thenuse something like this instead
ADO.Filter="UsrID=" & CInt(DataCombo1.text)
End if
End Sub