I am using a simple database (Access 2010, Windows 7) to keep records of inspections I do on construction projects. I have one table (Projects) that contains project criteria (Project Name, Contractor, etc.) "Project name" is the primary key in that table; it is a unique value.
I have a second table (Site Visits) that contains criteria concerning each inspection visit to a project. It has five fields: Date, Weather, Inspector name, Project name, Entry. "Entry" is a memo field that contains any observations for that particular visit. "Project name" is a text field that is linked to the same field in the other table.
I have a report that will print out all visits to a project. It's data source is a query. The query gets the project name from a combo box in a form where the user chooses the project. It also gets a date range from the same form where the user supplies that date range. I am using the correct syntax within the query to pull the name and date range from the open form; I have used this syntax many times in other Access applications, and it always has worked.
Last piece of info: the query on which the report is based has the date as the first field in the query and it is set to "sort ascending". Here's the problem:
The entries in the report are not sorted properly. The first several will be in order, then a gap in dates, then the missing dates are "salted" throughout the remaining entries! they are all there but in the wrong order. Oddly enough, the entries in table itself have been entered in chronological order. I have dozens of projects in this database, and all the reports have this sorting problem. I have checked each date entry to make sure there is not a typo in any of the dates.
I set this database up using the built-in functions of Access. I didn't write any code myself. I have used this "system" of creating reports from queries that use open forms to get the report criteria in several other Access databases and never had this problem. Any suggestions for a guy who doesn't write code??