What happened to QueryDef

A

AMCary

I am trying to write an sql statement in a form event procedure. The command
"Dim xxx as QueryDef" no longer seems to be exceptable syntax in Access 2007,
despite its appearance in the Northwind examples. How do I define a query to
call, if this doesn't work. BTW I have successfully written the sql to
function as a where command in a report opening DoCmd, but in this case I
want to open a RecordSet that is the query, but using input from a form to
define the where condition.
 
M

MGFoster

AMCary said:
I am trying to write an sql statement in a form event procedure. The command
"Dim xxx as QueryDef" no longer seems to be exceptable syntax in Access 2007,
despite its appearance in the Northwind examples. How do I define a query to
call, if this doesn't work. BTW I have successfully written the sql to
function as a where command in a report opening DoCmd, but in this case I
want to open a RecordSet that is the query, but using input from a form to
define the where condition.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Try:

Dim xxx As DAO.QueryDef

Make sure the DAO library is checked in the Tools > References dialog
box.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBSUxKeIechKqOuFEgEQJ43QCfdVt6GVeQHt09Gt7cFl6Jf9Q/hq0Aniaq
qm+nsMrpW9ROKm9vWq8GUIFr
=/hJM
-----END PGP SIGNATURE-----
 
B

Bob Barrows

Open a code window - does ctrl-g still do that in A2007?
Once you have a code window open, you can set the references for the
database.
 

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