You are on page 1of 1

Microsoft Access Techniques

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. 

Revision: 9/2/2012 Page 99 of 119


Copyright 2001–2012 by Susan J. Dorey

You might also like