title: Change content of a textbox with a source control
body: <p>I have to do some changes to a program that runs on Access 2003. </p>
  
  <p>I have a form where clicking on a certain button will change the text of a textbox depending on what is selected (image research).
  Originally, this textbox is linked to another hidden textbox that contain the original path for this image (the one in the database / unedited).</p>
  
  <p>My problem consists of the following: when I want the textbox that is linked to the DB to change to match the other textbox (containing the newest path), and thus allowing Access to save the changes, it just doesn't work. The textbox linked to the DB just goes blank.</p>
  
  <p>Here is the code I work with in VBA:</p>
  
  <pre><code>Public Sub SearchForImage(ByVal txtName As String, ByVal txtAuto As String)
      On Error Resume Next
      Dim B As String
  
      With Application.FileDialog(msoFileDialogOpen)
          .AllowMultiSelect = False
          .Show
          Me.Controls(txtName).SetFocus
          Me.Controls(txtName).Text = ""
          B = .SelectedItems(1)
      End With
      Me.Controls(txtAuto).SetFocus
      Me.Controls(txtAuto).Text = ""
      Me.Controls(txtAuto) = B
  End Sub
  </code></pre>
  
  <p>This allows me to change the text (along with another bit of code that isn't liked to the problem [it just make the text go blank before inputting the new value]). "txtName" represents the diffrent textbox I send to the function (these are not linked to the database in any way), and "txtAuto" the textbox linked to the database with a source control.</p>
  
  <p>Does anyone have an idea of why I can't change the value of this ? Is it because the textbox is linked with a source control ? Would it be better to directly save the content of 'B' in the database ?</p>