Hello guys
I need to create a kind of
Notice the user's notification message when the database or form is opened
There are records within 30 days of expiration.
I'm not sure if this Maybe
thank you
Hello guys
I need to create a kind of
Notice the user's notification message when the database or form is opened
There are records within 30 days of expiration.
I'm not sure if this Maybe
thank you
You could have a MsgBox popup or display info in textbox on form.
DCount("*", "tablename", "[ExpDate] BETWEEN Date() AND Date() + 30")
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Thank you June7
I used this code to show me an error message
Code:Private Sub Form_Load() Dim intContractCount As Integer intContractCount = Nz(DCount("ContractID", "Contracts", "Contracts.EndDate<=DateAdd('m',-1,Date()));"), 0) If intContractCount > 0 Then MsgBox Prompt:="The number of expiring contracts in the next month is " & intContractCount, Buttons:=vbOkayOnly, Title:="Alert" End If End Sub
There is no need for semi-colon, that will error. Paren following the quote mark is extra and that quote is in wrong position.
Nz(DCount("ContractID", "Contracts", "EndDate<=DateAdd('m',-1,Date())"), 0)
However, this will likely include records where the EndDate is prior to current date. Do you really want to count history? That's why I used the BETWEEN AND operator.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Thank you so much June7
This is what I want![]()