Running a select from the immediate window

  • Thread starter new2access123 via AccessMonster.com
  • Start date
N

new2access123 via AccessMonster.com

I want to create and test my queries in the immediate window before adding
them to my subs. In the immediate window i was able to create a table.

DoCmd.RunSQL "create table test ([ff1] text (5));"

I appended records using the same syntax DoCmd.RunSQL "..."

Now i want to query out all the records.

DoCmd.RunSQL "SELECT * from test;"

Does not work. What is the correct syntax to run a select in the immediate
window?

thanks
 
D

Douglas J. Steele

You can't. DoCmd.RunSQL only works with action queries: Insert Into, Delete,
Update.

Create a query, but don't select any tables. Switch to SQL view, paste your
SQL statement in and run the query.
 
Top