Popup Reminder

Ok sorted my problems over the weekend. I am now looking to add a second renewal date. In the same table is a renewal date for another item, at the moment this popup is in a seperate form however combining them into the same form is fine.

How would I get the popup to check for the renewal date of "VDU Renewal Date" as well as "Card Expiration Date"


The code looks like this at the moment

Code:
Private Sub Form_Load()
'On Load of the switchboard check Jobs table for any uncompleted jobs
Dim intStore As Integer
'Count of uncomplete jobs that are past the Expected Completion Date
intStore = DCount("[Employee Number]", "[contacts]", "[Card Expiration Date] Between #" & Date - 7 & "# And #" & Date + 3 & "#")
'If count of uncomplete jobs is zero display switchboard
'Else display message box detailing amount of jobs
'and give the user the option as to whether to view these or not.
    If intStore = 0 Then
         Exit Sub
    Else
         If MsgBox("There are " & intStore & " records due for renewal " & _
           vbCrLf & vbCrLf & "Would you like to see these now?", _
           vbYesNo, "You Have records due for renewal...") = vbYes Then
              DoCmd.Minimize
              DoCmd.OpenForm "renewal", acNormal
         Else
              Exit Sub
         End If
    End If
End Sub

Try something like this:

intStore = DCount("[Employee Number]", "[contacts]", "[Card Expiration Date] Between #" & Date - 7 & "# And #" & Date + 3 & "# or [VDU Renewal Date] Between #" & Date - 7 & "# And #" & Date + 3 & "#")
 
Actually it started working for a while but now whenever I startup the popup box appears saying there are entrys for renewal followed by a blank form. I havent changed anything within the code the only thing I think I have done is add new records. There are no records due for renewal.


Code:
Private Sub Form_Load()
'On Load of the switchboard check Jobs table for any uncompleted jobs
Dim intStore As Integer
'Count of uncomplete jobs that are past the Expected Completion Date
intStore = DCount("[Employee Number]", "[contacts]", "[Card Expiration Date] Between #" & Date - 7 & "# And #" & Date + 3 & "#")
'If count of uncomplete jobs is zero display switchboard
'Else display message box detailing amount of jobs
'and give the user the option as to whether to view these or not.
    If intStore = 0 Then
         Exit Sub
    Else
         If MsgBox("There are records due for renewal " & _
           vbCrLf & vbCrLf & "Would you like to see these now?", _
           vbYesNo, "You Have records due for renewal...") = vbYes Then
              DoCmd.Minimize
              DoCmd.OpenForm "renewal"
         Else
              Exit Sub
         End If
    End If
End Sub


Thanks for the reply however I got that issue sorted, however am having trouble with this post where if there is no dates due for renewal I still get the form pop up with no entries
 
You might want to post a copy of the database (with some bogus data of course).
 

Users who are viewing this thread

Back
Top Bottom