How can I do the dynamic select in Drupal 7 forms?
You need to focus on #ajax option. That will look like

$form['officers']['officer'] = array( 
  '#title' =&gt; t('Select the officer'), 
  '#type' =&gt; 'select', 
  '#description' =&gt; t('Please, select the officer'), 
  '#options' =&gt; array(), 
  '#multiple' =&gt; FALSE, 
  '#empty_value' =&gt; ' ',
  '#prefix' =&gt; '&lt;div id="officer-wrapper"&gt;',
  '#suffix' =&gt; '&lt;/div&gt;'
  '#empty_option' =&gt; '- None -',  
  '#ajax' =&gt; array(
     'callback' =&gt; 'path/to/callback/handler',
     'wrapper' =&gt; 'officer-wrapper',
     'method' =&gt; 'replace',
     'effect' =&gt; 'fade',
  ),
);


In the submit handler you will have change the form element for #options and render to post back using drupal_json_output.