Can someone help me to get the syntax correct? The global variable gstrDate is a string which can be either "[DueDate]" or "[Actual Completion Date]".
Code:
--------------------------------------------------------------------------------
strSQL = gstrDate & " Between #" & Me.BeginningDate & "# And #" & Me.EndingDate & "#) And "
--------------------------------------------------------------------------------
I used the debug.print strSQL, and it shows strSQL = "" . My code for the dates goes like this:
Code:
--------------------------------------------------------------------------------
If Not IsNull(IsDate(BeginningDate)) And Not IsNull(IsDate(EndingDate)) Then
If EndingDate < BeginningDate Then
MsgBox "The ending date must be later than the beginning date."
End If
Else
strSQL = gstrDate & " Between #" & Me.BeginningDate & "# And #" & Me.EndingDate & "#) And "
Debug.Print strSQL
End If
--------------------------------------------------------------------------------
There must be some detail that I'm missing that will get it to work.
Thanks,
PC
Code:
--------------------------------------------------------------------------------
strSQL = gstrDate & " Between #" & Me.BeginningDate & "# And #" & Me.EndingDate & "#) And "
--------------------------------------------------------------------------------
I used the debug.print strSQL, and it shows strSQL = "" . My code for the dates goes like this:
Code:
--------------------------------------------------------------------------------
If Not IsNull(IsDate(BeginningDate)) And Not IsNull(IsDate(EndingDate)) Then
If EndingDate < BeginningDate Then
MsgBox "The ending date must be later than the beginning date."
End If
Else
strSQL = gstrDate & " Between #" & Me.BeginningDate & "# And #" & Me.EndingDate & "#) And "
Debug.Print strSQL
End If
--------------------------------------------------------------------------------
There must be some detail that I'm missing that will get it to work.
Thanks,
PC