title: Refreshing User Form Textbox with VBA
body: <p>I have a UserForm that has a textbox that is populated from the <code>=Now()</code> function. However the data I am tracking runs on a 3 shift schedule, so "3rd shift" will technically be entering their data on next day. I have adjusted for this using an if statement, but my problem is getting my textbox to update on the change of a combo box that allows you to select what shift you're entering for. I tried the DoEvents function at the suggestion from another helpsite, but it did not work. Thanks in advance!</p>
  
  <p><code>Private Sub date_txtb_Change()
   If shift_cbox.Text = "Shift 1" Then
      date_txtb.Text = Format(Now(), "MM/DD/YY") 'Current Date
      DoEvents</code></p>
  
  <pre><code>ElseIf shift_cbox.Text = "Shift 2" Then
  date_txtb.Text = Format(Now(), "MM/DD/YY") 'Current Date
  DoEvents
  
  ElseIf shift_cbox.Text = "Shift 3" Then
  date_txtb.Text = Format(Now() - 1, "MM/DD/YY") 'Current Date -1
  DoEvents
  
  Else
  'do nothing'
  
  End If
  </code></pre>
  
  <p><code>End Sub</code>.          </p>