Im trying to get data from 2 tables to be part of this lookup.

When you choose an insurance from a dbcombo box I want it to run an SQL statement that looks at table1 and finds ALL of the matches in that table then takes the DrID field in the same table and matches it with the DrID field in a 2nd table.

But Im not sure how to do that...

Insurance Combo -> Matching insurances in table1 -> DrID field in table1 == DrID field in table 2 -> Display DrName, DrAddress (from table2) in MSHFlexgrid

I can display the data fine... im just not sure how create that type of SQL lookup.

USUALLY When I do something to fill a mshflexgrid I do it like this... So something that would work with the below code would be great! Thanks.

VB Code:
  1. Dim sConnect As String
  2.     Dim sSQL As String
  3.     Dim dfwConn As ADODB.Connection
  4.     Dim datPrimaryRs As New ADODB.Recordset
  5.        
  6.     'set strings
  7.     sConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" & frmlocation.Text1.Text & "';Persist Security Info=False"
  8.     sSQL = "select InsRecID, SpecID, Insurance, InsuranceID from DrsInsuranceList where SpecID like '" & Text7.Text & "'"
  9.    
  10.     ' open connection
  11.     Set dfwConn = New ADODB.Connection
  12.     dfwConn.Open sConnect
  13.    
  14.     'create a recordset using the provided collection
  15.     datPrimaryRs.CursorLocation = adUseClient
  16.     datPrimaryRs.Open sSQL, dfwConn, adOpenForwardOnly, adLockReadOnly
  17.    
  18.     Set MSHFlexGrid1.DataSource = datPrimaryRs