title: Access VBA - Passing a date variable from function to sub
body: <p>I have multiple queries that use the same date and want to ask the user only once</p>
  
  <pre><code>Public Sub runappends()
  Dim getmyparameter As Date
  
  Call getmyparameter1(getmyparameter)
  
  DoCmd.OpenQuery "Append to Current Quarter Counts 1", acViewNormal, acAdd
  
  DoCmd.OpenQuery "Append to Current Quarter Counts 2", acViewNormal, acAdd
  
  
  End Sub
  
  
  
  Public Function getmyparameter1(getmyparameter As Date)
  
  
  getmyparameter = CDate(InputBox("enter date greater than"))
  
  
  End Function
  </code></pre>
  
  <p>The query(s)  criteria is   <code>=&gt;getparameter1()</code> as the only option here is to call the function.</p>
  
  <p>But can't seem to get the date to pass to query 2,3, etc.?</p>