run Select Query as SQL statement

G

Guest

HI

I've been running Update/Delete/blah queries from SQL statements,
for some reason I can't get a select query to work with the DoCmd.RunSQL
statement.

I'm guessing it's for the same reason that you have to "Open" a select query
vs "executing" it. I wish I knew how to do it from VBA though =(

If anyone can help i'd really appreciate it!
Thanks
 
P

pietlinden

HI

I've been running Update/Delete/blah queries from SQL statements,
for some reason I can't get a select query to work with the DoCmd.RunSQL
statement.

I'm guessing it's for the same reason that you have to "Open" a select query
vs "executing" it. I wish I knew how to do it from VBA though =(

If anyone can help i'd really appreciate it!
Thanks

Congratulations. You've discovered that RunSQL does NOT work with non-
action queries. So what are you really trying to do with the records
you're intending to return? It would help to know that so we know how
to help...
 
G

Guest

Congratulations. You've discovered that RunSQL does NOT work with non-
action queries. So what are you really trying to do with the records
you're intending to return? It would help to know that so we know how
to help...


I've found that i'm really great at finding things that don't work. =)

I was going to export the select query because it would
remove/rearrange/rename all my tables, I just realized I can't export a SQL
statement though so it doesn't matter that I can't run it through VBA.

I think i'm just going to create a query and change the SQL design in that
query based on the If statements. Hopefully it works. =)
 

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