
03-30-2010, 12:15 PM
|
 |
Freshman
|
|
Join Date: Mar 2004
Posts: 30
|
|
I have created a selection query that will only show the date matched to the names.
Then in the code I use (shortened)
Code:
Dim dtDate As Date
Dim qry As String
qry = "Name of the selection query" 'This has to be the name you gave it, including the spaces, query between ""
If Not IsNull(DLookup("Datum", qry)) Then
dtDate = DLookup("Datum", qry)
End If
Then you can output the dtDate via various ways (msgbox, textbox, ...) or use it to compare.
I used it to check if the dtDate is older than 6 months or not, then show a popup.
Code:
If dtDate <> 0 Then
intDateDiff = DateDiff("d", dtDate, Date)
If (intDateDiff > 183) Then
popup = MsgBox("The date is older than 183 days.")
End If
End If
I'll be checking this thread for the next week, so if any question, now's the time 
|
|