Professional Documents
Culture Documents
Queries
You can always edit the data in a query when the query is based on either only one table or on
two tables that bear a one‐to‐one relationship to each other.
You can never edit the data in a query when:
The query is a crosstab query
The query is a SQL‐specific query—subqueries, pass‐through, union, and data‐definition
queries.
The field you are trying to edit is a calculated field.
The query is based on three or more tables and there is a many‐to‐one‐to‐many relationship.
The query contains a GROUP BY clause.
The query includes more than one table or query, and the tables or queries arenʹt joined by a
join line in Design view.
Parameter Queries
When a query starts, it can display a text box for you to enter an ad hoc value.
Can be used as basis for forms and reports.
To create, in Design View, enter prompt text in Criteria cell within square brackets, e.g.,
“[Which month?]” or “Between [Type the beginning date: ] And [Type the ending date: ]”.
Examples:
SELECT . . . FROM . . . WHERE Year = [Which year?]
SELECT ID, Name, [Which year?] AS Year FROM . . .
Be sure to trap [Cancel] in code or it will trigger the run‐time error 2001. You’ll need On
Error GoTo FormError which will close the form if Err.Number = 2001.