Hi Guys,
I have a form that has supplier names on it and I have now created a supplier ID as a primary key. Before I changed this the records were in alphabetical order. But when I created the ID they were sorted based on the supplier ID. I managed to change the form record source to a query that has the supplier name as a query field with the sort criteria switched to descending. This works on the form however I also have a report which is accessed from a button on the form that creates a list of all the suppliers and their details. This too is not now sorting in alphabetical order. I have tried changing the sources the same way as the form but this is not working. I have used the following code:
Is there something that I am missing??? THanks v much!
I have a form that has supplier names on it and I have now created a supplier ID as a primary key. Before I changed this the records were in alphabetical order. But when I created the ID they were sorted based on the supplier ID. I managed to change the form record source to a query that has the supplier name as a query field with the sort criteria switched to descending. This works on the form however I also have a report which is accessed from a button on the form that creates a list of all the suppliers and their details. This too is not now sorting in alphabetical order. I have tried changing the sources the same way as the form but this is not working. I have used the following code:
Code:
Private Sub cmdPrintPreview_Click()
Dim strReportName As String
Dim strCriteria As String
'Me.Refresh
strReportName = "rptSupplierDetails"
strCriteria = "[Sup_Name]"
DoCmd.OpenReport strReportName, acViewPreview, , strCriteria
End Sub