Open queries in code.

G

Guy Hocking

Hi there,

I realise this is probs a stupid question, but how do you open a query from
code as a macro would?

I need to run some error checking of a form before a command button call a
query, i thought that the most effective/only way of doing this was in
coding. but i can to the error checking but i cant open the blasted query
afterwards!!!

I tried OpenQuery to no avail.

If anyone could please give full details of how to open a query from code,
that would be great

Thanks in advance

--
GH

www.bradflack.com

Please remove ANTI and SPAM from my
email address before sending me an email.
 
G

Guy Hocking

OK DoCmd, got it, no probs.....

However, a different question -

How do i get a report to display data as a column, rather than seperate
tables for seperate records.
I want the data to appear like a table/query would.

Thanks

Guy
 
A

Alp Bekisoglu

Try using "Tabular View" while creating your form at the layout section of
Form Wizard.

Alp
 
J

Jim/Chris

From a Dwayne Hookum post
Place all you controls on the left third of the page and
select File|Page
Setup|Columns...

Jim
 
J

John Vinson

Hi there,

I realise this is probs a stupid question, but how do you open a query from
code as a macro would?

I need to run some error checking of a form before a command button call a
query, i thought that the most effective/only way of doing this was in
coding. but i can to the error checking but i cant open the blasted query
afterwards!!!

I tried OpenQuery to no avail.

If anyone could please give full details of how to open a query from code,
that would be great

Thanks in advance

It's very rarely necessary to open a Query in datasheet view. What
error checking are you doing? Why would opening a query datasheet help
in this effort?

DoCmd.OpenQuerydef("queryname")

will do it - but I wonder if there might not be some other way of
using the query to better advantage!
 

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