ChampionDuy
Registered User.
- Local time
- Today, 14:57
- Joined
- Mar 14, 2002
- Messages
- 94
I am using DCount to count query results. If a query does not return any values I want to message to say "No Activity Durning this quarter" Here is my code. Am I doing something Wrong? The first part of the If statement works fine but the Dcount gives me incorrect results.
If (LcAuth >= StartingDate And LcAuth <= EndingDate) Then
DoCmd.Close acForm, "QtrReport"
MsgBox ("This program Sucks")
ElseIf (LcExp >= StartingDate And LcExp <= EndingDate) Then
DoCmd.Close acForm, "QtrReport"
MsgBox (" I want to go Home ")
ElseIf (DCount("[renew_Date]", "[renewquery]")) > 0 Then
DoCmd.Close acForm, "QtrReport"
MsgBox ("Renew Date works")
ElseIf (DCount("[Int_date]", "[tardatequery]")) > 0 Then
MsgBox ("IntDate Works")
DoCmd.Close acForm, "QtrReport"
Else
MsgBox ("There is no activity in this quarter")
DoCmd.OpenForm "QtrReport"
End If
Renew_Date is a date that the RenewQuery is searching for. Same with Int_Date.
If (LcAuth >= StartingDate And LcAuth <= EndingDate) Then
DoCmd.Close acForm, "QtrReport"
MsgBox ("This program Sucks")
ElseIf (LcExp >= StartingDate And LcExp <= EndingDate) Then
DoCmd.Close acForm, "QtrReport"
MsgBox (" I want to go Home ")
ElseIf (DCount("[renew_Date]", "[renewquery]")) > 0 Then
DoCmd.Close acForm, "QtrReport"
MsgBox ("Renew Date works")
ElseIf (DCount("[Int_date]", "[tardatequery]")) > 0 Then
MsgBox ("IntDate Works")
DoCmd.Close acForm, "QtrReport"
Else
MsgBox ("There is no activity in this quarter")
DoCmd.OpenForm "QtrReport"
End If
Renew_Date is a date that the RenewQuery is searching for. Same with Int_Date.