title: Microsoft Access VBA pop up alert date approaching
body: <p>I am trying to write some VBA in Microsof Access (if VBA is the way to go?). What I need is a pop up message alerting someone that a deployment is happening within the next week. </p>
  
  <p>My table is called Tasks_List and there is a field called Deployment_Date.</p>
  
  <p>What I think I need is to put together an OnLoad for the initial form. It would check today's date and check through Deployoment_Date and show a pop up if any deployments are happening within the next week. The pop up should show what deployments are happening e.g. Initiating_System, Deployment_Date and Description. </p>
  
  <p>Thank you in advance, I've hit a brick wall on this. I'll post what I've tried but I have no VBA knowledge and it is pretty bad. </p>
  
  <p>What I tried: </p>
  
  <pre><code>Private Sub Report_Open(Cancel As Integer)
  Dim varX As Variant
  varX = DLookup(Tasks_List.[Deployment_Date]&lt; Now - 20)
  If varX &gt; 0 Then GoTo line2
  
  
  line1: msgbox "Deployment approacing for: "
  
  line2:
  
  
  End Sub 
  </code></pre>
  
  <p>EDIT: After help below I have created a query and form for this. Using Dcount:</p>
  
  <pre><code>Private Sub Detail_OnLoad()
      Deploy = DCount("*", "Tasks_List_Popup_Query")
  
      If Deploy &lt;&gt; 0 Then
          DoCmd.OpenForm "Tasks_List_Popup_Query_Form"
          DoCmd.GoToRecord , , acNewRec
  
      End If
  End Sub
  </code></pre>