title: MS Access. VBA. How to create a temporary table with 1 record only if it not exist
body: <p>I am looking for a way to Create a table when Form is opening.
  Table should be created just once. So if it exists new one should not be created.
  In the same form I would like to save some data from combo boxes in created table.
  To do that I tried to use a code:</p>
  
  <pre><code>  Sub ViaVBA()
      Const strSQLCreateFoo_c As String = _
            "CREATE TABLE Foo" &amp; _
            "(" &amp; _
            "MyField1 INTEGER," &amp; _
            "MyField2 Text(10)" &amp; _
            ");"
      Const strSQLAppendBs_c As String = _
            "INSERT INTO Foo (MyField1, MyField2) " &amp; _
            "SELECT Bar.MyField1, Bar.MyField2 " &amp; _
            "FROM Bar " &amp; _
            "WHERE Bar.MyField2 Like 'B*';"
  
      If Not TableExists("foo") Then
          CurrentDb.Execute strSQLCreateFoo_c
      End If
      CurrentDb.Execute strSQLAppendBs_c
  End Sub
  Private Function TableExists(ByVal name As String) As Boolean
      On Error Resume Next
      TableExists = LenB(CurrentDb.TableDefs(name).name)
  End Function
  </code></pre>
  
  <p>Unfortunately it is not saving selected values from combo boxes.
  It seems that the table has no records and it doesn't want to save the values.
  When I add at least one record that combo boxes are storing correct values.</p>
  
  <p>How to create a table with one record with some dummy info using the code posted above?</p>