private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // start DB transaction by opening it
        boolean connectSuccess=Helper.openConnection();
        // connection successful - proceed
        if(connectSuccess)
        {
            // get the results from the entered text, using the searcher method in our very own helper class
            ResultSet searchResults=Helper.searchAllByKey(globalSearchBox.getText());
            // assign the results to the appropriate table
            boolean assignSuccess=Helper.populateTable(searchResultsTable, searchResults);
            if (assignSuccess)
            {
                searchProductsMenuItemActionPerformed(null);
            }
            try {
                // notify if the result was empty
                if(searchResults.first()==false)
                {
                    JOptionPane.showMessageDialog(null, "No results for that search.");
                }
            } catch (SQLException ex) {
                // do notihng :)
            }
        }
        // create an array from the list of types
        String[] authCodesArray=listAuthCodes.split(",");
       
        // cycle through the table and colour code :)
        searchResultsTable.setDefaultRenderer(Object.class, new TableCellRenderer(){
           private DefaultTableCellRenderer DEFAULT_RENDERER =  new DefaultTableCellRenderer();

          @Override
          public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
              Component c = DEFAULT_RENDERER.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
              if(isSelected){
                  c.setBackground(Color.CYAN);
              }else{
                  // Green for permitted items, red for others - managers are permitted on all
                  if(Arrays.asList(authCodesArray).contains(table.getValueAt(row, 3).toString()) || staffLevel==2)
                  {
                      c.setBackground(new Color(128, 255, 128));
                  } 
                  else
                  {
                      c.setBackground(new Color(255, 128, 128));
                  }
              }   
              return c;
          }
    });
    // end DB transaction by closing it
    boolean closeSuccess=Helper.closeConnection();

    }//GEN-LAST:event_jButton1ActionPerformed