I'm trying to open a query from Microsoft Access that I have created and then sort the data by date. Can someone help me? It is saying object "CustomerService" is not open. "CustomerService" is the name of my query. Here is what I have.
' Create new instance of Microsoft Access.
Set appAccess = CreateObject("Access.Application")
' Open database in Microsoft Access window.
appAccess.OpenCurrentDatabase strConPath, True
' Open Orders form.
appAccess.DoCmd.SelectObject acQuery, "CustomerService"
appAccess.DoCmd.OpenQuery "CustomerService", acReadOnly
DoCmd.GoToRecord , acDataQuery, "CustomerService", acFirst
Also, is GoToRecord an ok way to go through the records to filter out by date? or is there a better way?