cheekybuddha
AWF VIP
- Local time
- Today, 23:50
- Joined
- Jul 21, 2014
- Messages
- 2,688
Oops! Managed to strip out a couple too many brackets from the end of the IsDate() function calls
Try:
Try:
Code:
SQL1 = "SELECT " & vbNewLine & _
" ID, " & vbNewLine & _
" IsDate([Forms]![Subform TPA]![Searchbox1]) AS Expr1, " & vbNewLine & _
" [Received Date], " & vbNewLine & _
" [Name Of Sender], " & vbNewLine & _
" Place, " & vbNewLine & _
" District, " & vbNewLine & _
" TPA" & vbNewLine & _
"FROM [Inward Register] " & vbNewLine & _
"WHERE (IsDate([Forms]![Subform TPA]![Searchbox1]) = False AND TPA Like '*" & [Forms]![View Inward Register]![Searchbox1] & "*') " & vbNewLine & _
" OR (IsDate([Forms]![Subform TPA]![Searchbox1]) = True AND [Received Date] = " & Format([Forms]![View Inward Register]![Searchbox1], "\#yyyy\-mm\-dd hh:nn:ss\#") & ") " & vbNewLine & _
"ORDER BY [Subform TPA].ID DESC;"
Debug.Print SQL1