title: Add/view attachments using MS Access VBA
body: <p>I'm trying to use these functions to manage an attachment table without using the in Access interface so people can't delete or break stuff, however, I'm getting Argument not Optional compiler errors whenever I try and call any of these functions.</p>
  
  <p><a href="http://blogs.office.com/b/microsoft-access/archive/2007/08/24/adding-removing-and-saving-files-from-the-new-attachment-field-in-access-2007.aspx" rel="nofollow">http://blogs.office.com/b/microsoft-access/archive/2007/08/24/adding-removing-and-saving-files-from-the-new-attachment-field-in-access-2007.aspx</a></p>
  
  <p>in the onclick event of a button i have </p>
  
  <pre><code>Database.OpenRecordset tblAttach
  Recordset.AddNew
  Call AddAttachment
  Recordset.Update
  </code></pre>
  
  <p>Another problem I'm having with this is that this code is only for importing from a direct path and I'd really need a file dialog method of file selection, but I'm not sure what to put beyond </p>
  
  <pre><code>Dim f As Object
  Set f = Application.FileDialog(3)
  f.AllowMultiSelect = False
  '*** not sure how to get the path to f to insert it into the table
  f.Show
  </code></pre>