I have a crosstab query that has an aggregate field in it that I can not automatically sort when the query runs in Access. I am making a VBA macro and am trying to run the query in there and also sort that particular field. I am not very experienced with VBA so I am getting errors. I am just not sure of the correct syntax. When I try it like below, I get a Data Type Conversion Error. Any help is appreciated. Thank you.
Set rsQuery = dbs.OpenRecordset("Name of my query here", "DoCmd.SetOrderBy Total DESC")
Set rsQuery = dbs.OpenRecordset("Name of my query here", "DoCmd.SetOrderBy Total DESC")