title: How to search Data in jTable using MS Acess using ComboBox with jTextField Netbeans
body: <p>In my program I can search data in jTable with this code using jTextfield "txtsearch" in my program.</p>
  
  <p>Please take a look at my actual program. Here is a picture:</p>
  
  <p><a href="https://i.stack.imgur.com/QZguC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QZguC.png" alt="http://i.stack.imgur.com/QZguC.png"></a>  </p>
  
  <p>This is my code in jTextField "txtsearch". In this code
  I can search the jTable via <code>Name</code> only. I want to search by using the jComboBox.</p>
  
  <pre><code>String a=txtsearch.getText();
  conn=MyConnection.ConnectDB();
  String sql="Select* from StdRecord WHERE Name LIKE'"+a+"%'";
  try{
      pst=conn.prepareStatement(sql);
      rst=pst.executeQuery();
      jTable1.setModel(DbUtils.resultSetToTableModel(rst));
  }catch(Exception e){}
  </code></pre>
  
  <p>Also, based on the image that I have uploaded, my question is: How can I search student by <code>Name</code>, <code>MiddleName</code> and <code>Surname</code> using the combo box?
  For Example, I select <code>MiddleName</code> in the combo box, then when I type in the jTextField "txtsearch" I can only search in <code>MiddleName</code> part of the table.</p>