How do I 'prompt' in Access???

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

SELECT COLUMN_1, COLUMN_2
FROM TABLE_NAME
WHERE COLUMN_2 = '&COLUMN_2';

I'm trying to manually enter 'COLUMN_2' to retrieve the data....
 
SELECT COLUMN_1, COLUMN_2
FROM TABLE_NAME
WHERE COLUMN_2 = [Enter Value];

I much prefer using a reference to a control on a form for setting criteria
in queries.
 
SELECT COLUMN_1, COLUMN_2
FROM TABLE_NAME
WHERE COLUMN_2 = [Enter COLUMN_2 value:];
 
SELECT COLUMN_1, COLUMN_2
FROM TABLE_NAME
WHERE COLUMN_2 = '&COLUMN_2';

I'm trying to manually enter 'COLUMN_2' to retrieve the data....

Access SQL IS NOT the same as T-SQL. *They are different*.

I realize that you may find it vexing, but try using the GUI query
builder and take a look at the SQL view of the result; it'll give you
a quick way to learn the dialect differences.

In this case, a parameter in Access is an expression in square
brackets (one which does not match any existing object in the table or
on any open form). Try

WHERE [Column_2] = [Enter Column_2:]

You'll be prompted

Enter Column_2:


John W. Vinson[MVP]
 
Back
Top