Hi there I am trying to help a coworker by letting her see when contracts are about to expire with a pop up form saying something like "Hey this contract is going to expire in X months time. Would you like to review it now?" I have been trying to work on it off and on for about 2 weeks now but I am not all that familiar with VB or Access that much and was wondering if someone knew a quick script for this?
I'm at a bit of a dead end on it.
Here is what I have so far
Code:
'On Load of the switchboard check Jobs table for any uncompleted jobs
Dim Store As Integer
'Count of uncomplete jobs that are past the Expected Completion Date
Store = DCount("[Contractor]", "[tblcontract]", "[End Date] <=Now() AND [Complete] =0")
'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 Store = 0 Then
Exit Sub
Else
If MsgBox("There are " & Store & " uncompleted jobs" & _
vbCrLf & vbCrLf & "Would you like to see these now?", _
vbYesNo, "You Have Uncomplete Jobs...") = vbYes Then
DoCmd.Minimize
DoCmd.OpenForm "Form", acNormal
Else
Exit Sub
End If
End If
End Sub
However with this, I keep getting errors in the Dcount function.
Any help would be greatly appreciated.
Thanks for your time