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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top