title: Select a value from a table in current DB and use a variable in Access VBA
body: <p>In Access VBA, I want to use values from a "Settings" table, instead of hard-coding folder locations etc. in the code. I can't figure out how to load a value from the table and use it in the code.</p>
  
  <pre><code>Dim oFSystem As Object
  Dim oFolder As Object
  Dim oFile As Object
  Dim sFolderPath As String
  
  
  
  sFolderPath = "C:\Documents and Settings\Main\Desktop\Files" 'BAD BAD, I WANT TO AVOID THIS
  </code></pre>
  
  <p>I have created a table "<strong>Settings</strong>", and I want to use the value</p>
  
  <pre><code>SELECT TOP 1 Settings.SettingsValue FROM Settings WHERE (((Settings.SettingName)="Files Folder Location"));
  </code></pre>