title: Powershell: Match combobox
body: <p>Been stuck on this for days... I have a winform with a combobox that is populated with "Contexts" from  an access table, When the user selects a context I want a textbox to populate with the matching "server" from that Colum in the same table.</p>
  
  <p>This is what I have so far..
  Thanks for any help!,</p>
  
  <pre><code>$conn=New-Object -com "ADODB.Connection"
  $rs = New-Object -com "ADODB.Recordset"
  
  $conn.Open ('Provider=Microsoft.ACE.OLEDB.12.0;DataSource=C:\users.mdb;Persist Security Info=True;')
  
  $rs.Open("SELECT * FROM tblContext",$conn,$adOpenStatic,$adLockOptimistic)
  
  $rs.MoveFirst()
  
  do {$rs.Fields.Item("Context").Value  
  
  $Label4ComboBox.items.add($rs.Fields.Item("Context").Value)
  $Label4ComboBox.AutoCompleteCustomSource.Add($rs.Fields.Item("Context").Value);
  $Label4ComboBox.AutoCompleteMode = [System.Windows.Forms.AutoCompleteMode]::SuggestAppend;
  $Label4ComboBox.AutoCompleteSource = [System.Windows.Forms.AutoCompleteSource]::CustomSource;
  $rs.MoveNext()
  
  $rs.Fields.Item("Server").Value;
  
  } until ($rs.EOF -eq $True)
  </code></pre>