G
Guest
Hello to all,
I have a report that's bound to a query. The query uses the DatePart
function to sort on the Policy Date field. When the query runs alone the sort
works fine, but when the query is called from the report the output is
unsorted. The report gets called from my form named Control Panel. Can anyone
help me solve this?
Here is the code from the form:
Private Sub Anniversaries_AfterUpdate()
DoCmd.OpenReport "Client Anniversary", acViewPreview
End Sub
Here is the code from the query:
SELECT DISTINCTROW Clients.[First Name], Clients.[Last Name],
Clients.Address, Clients.City, Clients.State, Clients.[Zip Code],
Clients.[Policy Date]
FROM Clients
WHERE (((Month([Clients].[Policy Date]))=[Forms]![Control
Panel]![Anniversaries]))
ORDER BY DatePart("d",[Policy Date]);
I have a report that's bound to a query. The query uses the DatePart
function to sort on the Policy Date field. When the query runs alone the sort
works fine, but when the query is called from the report the output is
unsorted. The report gets called from my form named Control Panel. Can anyone
help me solve this?
Here is the code from the form:
Private Sub Anniversaries_AfterUpdate()
DoCmd.OpenReport "Client Anniversary", acViewPreview
End Sub
Here is the code from the query:
SELECT DISTINCTROW Clients.[First Name], Clients.[Last Name],
Clients.Address, Clients.City, Clients.State, Clients.[Zip Code],
Clients.[Policy Date]
FROM Clients
WHERE (((Month([Clients].[Policy Date]))=[Forms]![Control
Panel]![Anniversaries]))
ORDER BY DatePart("d",[Policy Date]);